{"Entry":{"collection":"guc","key":"wal_recycle","name":"wal_recycle","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Write-Ahead Log / Settings","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"11","status":"added","to":"12"}],"content_hash":"d38f14911b9599932866f5098b044116419c1e9906ee1d965f011f07049d1ade","context":"","default_changed_in":[],"default_history":[{"from":"12","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Provision WAL, archive bandwidth, and recovery I/O for bulk-load peaks. Coordinate load pacing and checkpoints when reducing spikes; never break the recovery chain for throughput.","oltp":"Establish durability and recovery objectives first, then tune wal_recycle from WAL rate, flush latency, checkpoints, and peak pg_wal usage. Validate every change with crash/recovery and archive monitoring.","small":"Start from safe defaults and set explicit alerts for limited disk capacity. Do not disable durability or break the recovery chain merely to save modest I/O."},"mechanism":["Recycles WAL files by renaming them. A superuser or a role granted SET privilege can change it for the relevant session or configuration scope.","With on, PostgreSQL renames no-longer-needed WAL segments for future use rather than creating new files. Reuse is usually cheaper, but on copy-on-write storage fresh allocation can perform better and avoid preserving extents.","Monitor and change wal_recycle together with wal_init_zero, wal_segment_size, min_wal_size. Validate on the relevant server role and real workload, then use its superuser context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Assuming recycled renames are always faster than new allocation on copy-on-write storage.","Disabling recycling without measuring segment creation latency during WAL bursts.","Expecting a session change to alter files already recycled or removed.","Treating recycling as a WAL retention limit rather than a file-reuse policy."],"references":[{"title":"PostgreSQL 19 Beta 4: wal_recycle","url":"https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-WAL-RECYCLE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["wal_init_zero","wal_segment_size","min_wal_size","max_wal_size","commit_delay","commit_siblings"],"summary":"wal_recycle recycles WAL files by renaming them. It is a superuser setting present in PG12–18; the latest recorded boot default is on."},"enumvals":[],"first_version":"12","group":"Write-Ahead Log","group_slug":"wal","imported_at":"2026-09-27T17:57:32.357435+08:00","intro_commit":{"authored_at":"2019-04-02T14:37:14+13:00","discussion":["https://postgr.es/m/CACPQ5Fo00QR7LNAcd1ZjgoBi4y97%2BK760YABs0vQHH5dLdkkMA%40mail.gmail.com"],"hash":"475861b2615dd63ae8431d811749a6f9a15bbfd6","subject":"Add wal_recycle and wal_init_zero GUCs.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=475861b2615dd63ae8431d811749a6f9a15bbfd6"},"key":"wal_recycle","last_version":"20","max_val":"","min_val":"","name":"wal_recycle","position":476,"present_in":["12","13","14","15","16","17","18","19","20"],"short_desc":"If set to on (the default), this option causes WAL files to be recycled by renaming them, avoiding the need to create new ones.","short_desc_zh":"","source_rev":"english-manuals:1cd61b2d02bd97d8cff5c90091de75c5b12fdd3894b446dc97794eacc2a28d32","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"wal_recycle","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"wal_recycle","SourceRevision":"english-manuals:1cd61b2d02bd97d8cff5c90091de75c5b12fdd3894b446dc97794eacc2a28d32","Facts":{"boot_val":"on","category":"Write-Ahead Log / Settings","context":"superuser","description":"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.","doc":{"anchor":"GUC-WAL-RECYCLE","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"wal_recycle","short_desc":"Recycles WAL files by renaming them.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-WAL-RECYCLE","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"wal_recycle","SourceDatabase":"center","Version":"18","Locale":"en","Title":"wal_recycle","Summary":"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.","BodyHTML":"\u003cp\u003eIf 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.\u003c/p\u003e","SourceRevision":"english-manuals:1cd61b2d02bd97d8cff5c90091de75c5b12fdd3894b446dc97794eacc2a28d32","ContentHash":"8f77b074c866c026790bc7d20a08f2b1d564561fecc173cba93ed09426cbd4bf","Payload":{"description":"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."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
