Configuration parameter

wal_recycle — PostgreSQL configuration parameter

Category Write Ahead Log

If set to on (the default), this option causes WAL files to be recycled by renaming them, avoiding the need to create new ones.

At a glance

Property Value
Parameter wal_recycle
Category Write Ahead Log
Default on
Value type boolean (on/off)
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

If set to on (the default), this option causes WAL files to be recycled by renaming them, avoiding the need to create new ones. On COW file systems, it may be faster to create new ones, so the option is given to disable this behavior.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW wal_recycle; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'wal_recycle';.

Tuning guidance

Leave it on so WAL files are recycled (renamed) rather than recreated; turning it off can help on copy-on-write filesystems (ZFS) where recycling hurts. Benchmark before changing.

Reference

PostgreSQL documentation — wal_recycle.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters