Parameter · Developer Options
wal_consistency_checking
Sets the WAL resource managers for which WAL consistency checks are done. Full-page images will be logged for all data blocks and cross-checked against the results of WAL replay.
- Default:
'' (empty) - Type: string
- Applies: Session (superuser)
In plain words
A tool for PostgreSQL developers to check that WAL replay works. For the selected kinds of WAL records, the primary writes a full copy of each changed page into WAL. During replay, the result of applying the record is compared byte by byte with that copy; any difference is a bug, and recovery stops.
For DBAs and operators
The value is all or a comma-separated list of resource managers: heap, heap2, btree, hash, gin, gist, sequence, spgist, brin, generic, and custom resource managers from extensions. Unknown names fail with DETAIL: Unrecognized key word: "bogus".
On a mismatch during replay the startup process stops with
FATAL: inconsistent page found, rel 1663/5/24695, forknum 0, blkno 0It works in standard builds, but it makes WAL very large (every record carries a page image), so it belongs on test systems, typically a primary with a streaming standby that replays the WAL. Hint bits and other parts of the page that may legitimately differ are masked before comparison. Extension authors who write custom WAL resource managers use it to test their redo functions.
Developer option: meant for debugging and testing PostgreSQL itself. Leave it at the default on production servers unless a specific diagnosis calls for it.
How to change it
A superuser (or a role granted SET) can change it per session with SET.
See it in context
Write-ahead log (WAL) Full-page writes Crash recovery Streaming replication