PG_WALDUMP(1)
πΈ PG_WALDUMP(1) πΈ
okay bestie, so this is a page straight out of the PostgreSQL 15.19 Documentation and it's all about pg_waldump, which is genuinely one of my fave little detective tools, no cap π
β¨ NAME β¨
pg_waldump β displays a human-readable rendering of the write-ahead log of a PostgreSQL database cluster π
π¦ SYNOPSIS π¦
pg_waldump [option...] [startseg [endseg]]
π DESCRIPTION π
So pg_waldump displays the write-ahead log (WAL), and honestly it's mainly useful for debugging or educational purposes β think of it as reading the diary the database writes to itself π«Ά
okay important thing, bestie: this utility can only be run by the user who installed the server, because it requires read-only access to the data directory. that's the vibe check, and it's non-negotiable π
π OPTIONS π
These command-line options control the location and format of the output, and there's a lot of them, so buckle up π
startsegβ start reading at the specified log segment file. This implicitly determines the path in which files will be searched for, and the timeline to use. like, it just knows β¨endsegβ stop after reading the specified log segment file.-b,--bkp-detailsβ output detailed information about backup blocks. all the receipts, iykyk π- *
-B*block,--block=block β only display records that modify the given block. The relation must also be provided with--relationor-R. you can't just go naming blocks with no relation, that's not how we do things π - *
-e*end,--end=end β stop reading at the specified WAL location, instead of reading to the end of the log stream. boundaries, we love them π -f,--followβ after reaching the end of valid WAL, keep polling once per second for new WAL to appear. she's patient, she's loyal, she's refreshing π§- *
-F*fork,--fork=fork β if provided, 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. we're leaving before it gets weird π - *
-p*path,--path=path β specifies a directory to search for log 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. she'll go looking for you, don't worry π¦ -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. lowkey the "did it parse tho" option π- *
-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. one rmgr is cute, multiple rmgrs is a party π
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. custom names stay iconic, fr fr π
- *
-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. slashes slay πΈ - *
-s*start,--start=start β WAL location at which to start reading. The default is to start reading the first valid log record found in the earliest file found. start at the very beginning, a very good place to start π - *
-t*timeline,--timeline=timeline β timeline from which to read log records. The default is to use the value instartseg, if that is specified; otherwise, the default is1. different timelines, different multiverses π -V,--versionβ print thepg_waldumpversion and exit. drop the version number and dip βοΈ-w,--fullpageβ only display records that include full page images. full page images only, she's picky π- *
-x*xid,--xid=xid β only display records marked with the given transaction ID. specific transaction energy π -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. she's giving data analyst, she's giving dashboards π
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. rip to the Windows girlies π
-?,--helpβ show help aboutpg_waldumpcommand line arguments, and exit. when in doubt, ask for help, bestie π«Ά
π ENVIRONMENT π
PGDATAβ data directory; see also the-poption. this is where your data lives, treat her well πPG_COLORβ specifies whether to use color in diagnostic messages. Possible values arealways,autoandnever. yes, you can force the aesthetic π¨
β NOTES β
can give wrong results when the server is running. like, she's trying her best, but a running server means the WAL is moving, and that's just not a stable relationship π¬
Only the specified timeline is displayed (or the default, if none is specified). Records in other timelines are ignored. we don't do multiverse crossovers here π ββοΈ
pg_waldump cannot read WAL files with suffix .partial. If those files need to be read, .partial suffix needs to be removed from the file name. so close and yet so far π
π§ SEE ALSO π§
Section 30.6 β go read it, it's giving required reading β¨
and that's the whole page, bestie! mwah π
signing off with love: this was PostgreSQL 15.19, dated 2026 β PG_WALDUMP(1), no cap πΈππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-server 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-server 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-server 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15-server 15.19-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