PG_WALDUMP(1)

πŸ“¦ version 17.11, in opensuse-leap 16.0

πŸ’… 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 πŸ’…
  • -B block, --block=block β€” only display records that modify the given block. heads up: the relation must **also be provided with --relation or -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 are main for the main fork, fsm for the free space map, vm for the visibility map, and init for 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 a pg_wal subdirectory that contains such files. the default is to search in the current directory, the pg_wal subdirectory of the current directory, and the pg_wal subdirectory of PGDATA.
  • -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. if list is 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 example 1234/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 in startseg, if that is specified; otherwise, the default is 1. the value can be specified in decimal or hexadecimal, for example 17 or 0x11. both? both. 🌈
  • -V, --version β€” print the pg_waldump version 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 the save_path directory. 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 %08X
  • LSN β€” the LSN of the record with this image, formatted as two 8-character hexadecimal numbers %08X-%08X
  • RELTABLESPACE β€” tablespace OID of the block
  • DATOID β€” database OID of the block
  • RELNODE β€” filenode of the block
  • BLKNO β€” block number of the block
  • FORK β€” the name of the fork the full page image came from, such as main, fsm, vm, or init.
  • -?, --help β€” show help about pg_waldump command line arguments, and exit. when in doubt, ask for help, no shame πŸ’–

🌱 ENVIRONMENT

  • PGDATA β€” data directory; see also the -p option. the classic.
  • PG_COLOR β€” specifies whether to use color in diagnostic messages. possible values are always, auto and never. 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_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. 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 πŸŒˆπŸ’–