PG_WALDUMP(1)
π PG_WALDUMP(1) π
okay bestie, pull up a chair, because this is pg_waldump from the PostgreSQL 18.6 manual β it lives in section 1 of the manual pages, and it's literally the little tool that lets you stare directly into the write-ahead log of a PostgreSQL database cluster. no cap. let's get into it π«Ά
β¨ NAME β¨
pg_waldump β displays a human-readable rendering of the write-ahead log of a PostgreSQL database cluster. it's giving "here's what your WAL was actually doing" π
πΈ SYNOPSIS πΈ
pg_waldump [option...] [startseg [endseg]]
π¦ DESCRIPTION π¦
So pg_waldump shows you the write-ahead log, aka the WAL, and honestly? it's mainly there for debugging or educational purposes. like, this is the tool you use when you're being a nerd on purpose and you want to know what's in there π
bestie, important: this utility can only be run by the user who installed the server. why? because it needs read-only access to the data directory. that's the vibe check, and you have to pass it π
β¨ OPTIONS β¨
These are the command-line options that control where the output comes from and what shape it takes, okay?
startsegβ start reading at this specific WAL segment file. sneaky detail: this also implicitly decides the path where files get searched for, and the timeline to use. so it's doing two jobs, main character energy fr.endsegβ stop after reading this specified WAL segment file. that's the finish line π
-b,--bkp-detailsβ output detailed info about backup blocks.-Bblock,--block=block β only show records that modify the given block. and heads up: you **also have to provide the relation, using--relationor-R. it's a package deal π- *
-e*end,--end=end β stop reading at the specified WAL location, instead of reading all the way to the end of the log stream. -f,--followβ after it reaches the end of valid WAL, it just keeps polling once per second waiting for new WAL to show up. obsessed with the dedication honestly.- *
-F*fork,--fork=fork β only display records that modify blocks in the given fork. valid values aremainfor the main fork,fsmfor the free space map,vmfor the visibility map, andinitfor the init fork. - *
-n*limit,--limit=limit β show exactly this many records, then stop. boundaries, we love them β - *
-p*path,--path=path β tells it which directory to search for WAL segment files, or a directory that has apg_walsubdirectory containing such files. the default is to search in the current directory, thepg_walsubdirectory of the current directory, and thepg_walsubdirectory ofPGDATA. -q,--quietβ print literally no output except errors. ngl this one's lowkey iconic: it's useful when you just wanna know whether a range of WAL records can be successfully parsed and you do not care about the record contents.- *
-r*rmgr,--rmgr=rmgr β only display records generated by the specified resource manager. you can pass this option multiple times to select multiple resource managers. and if you passlistas the name, it prints a list of valid resource manager names and exits. slay.- Extensions may define custom resource managers, but
pg_waldumpdoes not load the extension module, so it doesn't recognize custom resource managers by name. instead, you can specify the custom resource managers ascustom###where###is the three-digit resource manager ID. names of this form are always considered valid. good to know iykyk π
- Extensions may define custom resource managers, but
- *
-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 queen π - *
-s*start,--start=start β the 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 β the timeline from which to read WAL records. default is to use the value instartseg, if that's specified; otherwise the default is1. and you can write the value in decimal or hexadecimal, for example17or0x11. flexible π -V,--versionβ print thepg_waldumpversion and exit.-w,--fullpageβ only display records that include full page images.- *
-x*xid,--xid=xid β only display records marked with the given transaction ID. -z,--stats[=record]β display summary statistics (the number and size of records and full-page images) instead of individual records. optionally, generate statistics per-record instead of per-rmgr. and listen: ifpg_waldumpgets terminated by signalSIGINT(that's Control+C for you and me), the summary of the statistics computed is displayed up to the termination point. but this operation is not supported on Windows β sorry Windows besties π--save-fullpage=save_path β save full page images found in the WAL records to the save_path directory. the images saved are subject to the **same filtering and limiting criteria as the records displayed β so your filters apply to the files too, no sneaking around it.- 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 these parts:
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.
- The full page images are saved with the following file name format:
-?,--helpβ show help aboutpg_waldumpcommand line arguments, and exit. when in doubt π
π ENVIRONMENT π
PGDATAβ the data directory; see also the-poption. (they're besties, they work together π«Ά)PG_COLORβ specifies whether to use color in diagnostic messages. possible values arealways,autoandnever. yes, we do care about aesthetics in our diagnostics πΈ
β NOTES β
Can give wrong results when the server is running. not me warning you twice, but... yeah. be careful bestie.
- Only the specified timeline is displayed (or the default, if none is specified). records in other timelines are ignored, periodt.
pg_waldumpcannot read WAL files with the suffix.partial. if those files need to be read, the.partialsuffix needs to be removed from the file name. like, physically renamed. it's not being dramatic, it just refuses π
π SEE ALSO π
Section 28.6 π
and that's the whole page, bestie! this was PG_WALDUMP(1) from PostgreSQL 18.6, dated 2026 β go forth and read your WAL responsibly π¦β¨π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18-server 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18-server 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18-server 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18-server 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms