PG_WALDUMP(1)

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

✨ NAME ✨

Okay bestie, welcome to the PG_WALDUMP(1) manual page β€” this is all about pg_waldump, which displays a human-readable rendering of the write-ahead log of a PostgreSQL database cluster. It's giving β€œWAL but make it readable” energy πŸ’…


🌸 SYNOPSIS 🌸

pg_waldump [option...] [startseg [endseg]]

πŸ’– DESCRIPTION πŸ’–

pg_waldump displays the write-ahead log (WAL) and is mainly useful for debugging or educational purposes. No cap, it's the tool you reach for when you wanna peek at WAL records instead of just vibing with mystery bytes πŸ¦‹

This utility can only be run by the user who installed the server, because it requires read-only access to the data directory. So yeah, permissions matter, bestie β€” it's not a β€œrun it as anyone” situation πŸ™ˆ


πŸŽ€ OPTIONS πŸŽ€

The following command-line options control the location and format of the output β€” read 'em and weep, bestie:

  • 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. It's literally picking your starting point ✨
  • endseg β€” Stop after reading the specified log segment file. That's the finish line, periodt 🏁
  • -b, --bkp-details β€” Output detailed information about backup blocks. Backup block lore unlocked πŸ”₯
  • -e end, --end=end β€” Stop reading at the specified WAL location, instead of reading to the end of the log stream. You set the stop point, bestie πŸ›‘
  • -f, --follow β€” After reaching the end of valid WAL, keep polling once per second for new WAL to appear. It's giving β€œwait for it… wait for it…” energy πŸ‘€
  • -n limit, --limit=limit β€” Display the specified number of records, then stop. Snack-sized WAL output πŸ“
  • -p path, --path=path β€” Specifies a directory to search for log 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. Path hunting: iconic πŸ”
  • -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. Silent mode, but make it useful 🀫
  • -r rmgr, --rmgr=rmgr β€” Only display records generated by the specified resource manager. If list is passed as name, print a list of valid resource manager names, and exit. Filtered records, filtered vibes πŸ’…
  • -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. Choose your beginning, main character style 🌟
  • -t timeline, --timeline=timeline β€” Timeline from which to read log records. The default is to use the value in startseg, if that is specified; otherwise, the default is 1. Timeline selection is lowkey important 🧚
  • -V, --version β€” Print the pg_waldump version and exit. Version check, slay πŸ’–
  • -x xid, --xid=xid β€” Only display records marked with the given transaction ID. XID filter, activated ⭐
  • -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. Stats girlies rise 🌈
  • -?, --help β€” Show help about pg_waldump command line arguments, and exit. Help is always a vibe 🫢

πŸ¦‹ ENVIRONMENT πŸ¦‹

  • PGDATA β€” Data directory; see also the -p option. It's the home base of your data 🏑
  • PG_COLOR β€” Specifies whether to use color in diagnostic messages. Possible values are always, auto and never. Color choice is a whole personality πŸ’œ

🌈 NOTES 🌈

⚠️ Can give wrong results when the server is running. That's a real heads-up, bestie β€” don't ignore it 😭

Only the specified timeline is displayed (or the default, if none is specified). Records in other timelines are ignored. Timeline boundaries are respected, no crossover drama 🚫

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. Yep, you gotta rename it β€” the .partial has to go πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ

Section 29.5


Cute sign-off time: this page is from PostgreSQL 13.23, dated 2025. Stay slay, bestie πŸ«ΆπŸ’–