wal_debug
A system parameter for emitting WAL debugging output
wal_debug
is a configuration parameter for emitting WAL-related debugging information.
wal_debug
was added in PostgreSQL 7.1.
Usage
wal_debug
can only be enabled if the PostgreSQL instance was compiled with WAL_DEBUG
set (this must be set manually in src/include/pg_config_manual.h
), otherwise
Default value
The default value for wal_debug
is: off
.
Change history
- PostgreSQL 7.1
- added (commit b0299c5d)
Examples
Attempting to use wal_debug
on an instance where the WAL_DEBUG
macro was not set at compile time:
postgres=# SHOW wal_debug; ERROR: unrecognized configuration parameter "wal_debug"
Log output when enabling wal_debug on an instance where it is available:
[2022-06-09 08:52:57 UTC] psql postgres postgres LOG: 00000: statement: ALTER SYSTEM SET wal_debug = on; [2022-06-09 08:52:57 UTC] psql postgres postgres LOCATION: exec_simple_query, postgres.c:1053 [2022-06-09 08:52:59 UTC] psql postgres postgres LOG: 00000: statement: SELECT pg_reload_conf(); [2022-06-09 08:52:59 UTC] psql postgres postgres LOCATION: exec_simple_query, postgres.c:1053 [2022-06-09 08:52:59 UTC] LOG: 00000: received SIGHUP, reloading configuration files [2022-06-09 08:52:59 UTC] LOCATION: SIGHUP_handler, postmaster.c:2763 [2022-06-09 08:52:59 UTC] LOG: 00000: parameter "wal_debug" changed to "on" [2022-06-09 08:52:59 UTC] LOCATION: ProcessConfigFileInternal, guc-file.l:455
Subsequent log output will contain extensive WAL debug information such as:
[2022-06-09 08:53:29 UTC] LOG: 00000: INSERT @ 0/3000868: - XLOG/FPI_FOR_HINT: [2022-06-09 08:53:29 UTC] LOCATION: XLogInsertRecord, xlog.c:1000 [2022-06-09 08:53:29 UTC] LOG: 00000: INSERT @ 0/3000DF8: - XLOG/FPI_FOR_HINT: [2022-06-09 08:53:29 UTC] LOCATION: XLogInsertRecord, xlog.c:1000 [2022-06-09 08:53:29 UTC] LOG: 00000: INSERT @ 0/3000E50: - Heap2/PRUNE: latestRemovedXid 0 nredirected 2 ndead 3 [2022-06-09 08:53:29 UTC] LOCATION: XLogInsertRecord, xlog.c:1000
References
- PostgreSQL documentation: wal_debug