PG_WALDUMP(1)
π pg_waldump(1) β the WAL tea, spilled
okay bestie, so this page is pg_waldump from the PostgreSQL 17.11 manual, and it's literally the tool that reads the write-ahead log of a PostgreSQL database cluster and gives you a human-readable rendering of it β¨ like, it translates the WAL into something your eyeballs can actually survive.
π NAME
pg_waldump β display a human-readable rendering of the write-ahead log of a PostgreSQL database cluster. that's it, that's the gig π
π¦ SYNOPSIS
pg_waldump [option...] [startseg [endseg]]
πΈ DESCRIPTION
so pg_waldump displays the write-ahead log (WAL), and it's mainly useful for debugging or educational purposes β like, it's giving "study buddy" and "detective mode" energy, not "production main character" energy, yk?
also important: this utility can only be run by the user who installed the server, because it requires read-only access to the data directory. no cap, that's a hard requirement π
β¨ OPTIONS β¨
the following command-line options control the location and format of the output β there's kind of a lot of them, so buckle up π’
startsegβ start reading at the specified WAL segment file. this implicitly determines the path in which files will be searched for, and the timeline to use. lowkey two-for-one π«Άendsegβ stop after reading the specified WAL segment file.-b,--bkp-detailsβ output detailed information about backup blocks. the receipts on backups, basically π-Bblock,--block=block β only display records that modify the given block. heads up: the relation must **also be provided with--relationor-R. they're a package deal, fr.- *
-e*end,--end=end β stop reading at the specified WAL location, instead of reading to the end of the log stream. it's giving "i've seen enough" β -f,--followβ after reaching the end of valid WAL, keep polling once per second for new WAL to appear. it literally waits by the phone for new WAL π- *
-F*fork,--fork=fork β only display records that modify blocks in the given fork. the valid values aremainfor the main fork,fsmfor the free space map,vmfor the visibility map, andinitfor the init fork. pick your fighter π₯ - *
-n*limit,--limit=limit β display the specified number of records, then stop. portion control π - *
-p*path,--path=path β specifies a directory to search for WAL segment files or a directory with apg_walsubdirectory that contains such files. the default is to search in the current directory, thepg_walsubdirectory of the current directory, and thepg_walsubdirectory ofPGDATA. -q,--quietβ do not print any output, except for errors. this option can be useful when you want to know whether a range of WAL records can be successfully parsed but don't care about the record contents. it's the "just tell me if it works" option, iconic π- *
-r*rmgr,--rmgr=rmgr β only display records generated by the specified resource manager. you can specify the option multiple times to select multiple resource managers. iflistis passed as name, print a list of valid resource manager names, and exit.
extensions may define custom resource managers, but pg_waldump does not load the extension module and therefore does not recognize custom resource managers by name. instead, you can specify the custom resource managers as custom### where ### is the three-digit resource manager ID. names of this form will always be considered valid. iykyk π§
- *
-R*tblspc/db/rel,--relation=tblspc/db/rel β only display records that modify blocks in the given relation. the relation is specified with tablespace OID, database OID, and relfilenode separated by slashes, for example1234/12345/12345. this is the same format used for relations in the program's output. consistency slay π - *
-s*start,--start=start β WAL location at which to start reading. the default is to start reading the first valid WAL record found in the earliest file found. - *
-t*timeline,--timeline=timeline β timeline from which to read WAL records. the default is to use the value instartseg, if that is specified; otherwise, the default is1. the value can be specified in decimal or hexadecimal, for example17or0x11. both? both. π -V,--versionβ print thepg_waldumpversion and exit.-w,--fullpageβ only display records that include full page images. full-page-image girlies rise π- *
-x*xid,--xid=xid β only display records marked with the given transaction ID. - *
-z,--stats[=record*] β display summary statistics (number and size of records and full-page images) instead of individual records. optionally generate statistics per-record instead of per-rmgr.
if pg_waldump is terminated by signal SIGINT (Ctrl+C), the summary of the statistics computed is displayed up to the termination point. this operation is not supported on Windows π
- *
--save-fullpage=save_path* β save full page images found in the WAL records to thesave_pathdirectory. the images saved are subject to the same filtering and limiting criteria as the records displayed. like, same rules, no exceptions π«Ά
the full page images are saved with the following file name format:
TIMELINE-LSN.RELTABLESPACE.DATOID.RELNODE.BLKNO_FORK
the file names are composed of the following parts β bestie this is the whole anatomy lesson:
TIMELINEβ the timeline of the WAL segment file where the record is located, formatted as one 8-character hexadecimal number%08XLSNβ the LSN of the record with this image, formatted as two 8-character hexadecimal numbers%08X-%08XRELTABLESPACEβ tablespace OID of the blockDATOIDβ database OID of the blockRELNODEβ filenode of the blockBLKNOβ block number of the blockFORKβ the name of the fork the full page image came from, such asmain,fsm,vm, orinit.
-?,--helpβ show help aboutpg_waldumpcommand line arguments, and exit. when in doubt, ask for help, no shame π
π± ENVIRONMENT
PGDATAβ data directory; see also the-poption. the classic.PG_COLORβ specifies whether to use color in diagnostic messages. possible values arealways,autoandnever. yes you can turn the sparkle on and off β¨
π NOTES
- can give wrong results when the server is running. like, do not trust it mid-flight, fr fr. that's a real caveat, not a vibe.
- only the specified timeline is displayed (or the default, if none is specified). records in other timelines are ignored. other timelines are literally not invited to this party π
pg_waldumpcannot read WAL files with suffix.partial. if those files need to be read,.partialsuffix needs to be removed from the file name. it simply refuses, and honestly? respect π
π¦ SEE ALSO
Section 28.6
okay that's the whole page, you're officially WAL-literate ππ
and for the record: this was the PostgreSQL 17.11 documentation, dated 2026, page PG_WALDUMP(1) β mwah, go read some write-ahead log, it's giving main character energy ππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-server 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17-server 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17-server 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17-server 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms