pg_xlogdump
pg_xlogdump — display a human-readable rendering of the write-ahead log of a PostgreSQL database cluster
Synopsis
pg_xlogdump [option...] [startseg [endseg] ]
Description
pg_xlogdump displays the write-ahead log (WAL) and is mainly useful for debugging or educational purposes.
This utility can only be run by the user who installed the server, because it requires read-only access to the data directory.
Options
The following command-line options control the location and format of the output:
startsegStart reading at the specified log segment file. This implicitly determines the path in which files will be searched for, and the timeline to use.
endsegStop after reading the specified log segment file.
-b--bkp-detailsOutput detailed information about backup blocks.
-eend--end=endStop reading at the specified log position, instead of reading to the end of the log stream.
-f--followAfter reaching the end of valid WAL, keep polling once per second for new WAL to appear.
-nlimit--limit=limitDisplay the specified number of records, then stop.
-ppath--path=pathDirectory in which to find log segment files. The default is to search for them in the
pg_xlogsubdirectory of the current directory.-rrmgr--rmgr=rmgrOnly display records generated by the specified resource manager. If
listis passed as name, print a list of valid resource manager names, and exit.-sstart--start=startLog position at which to start reading. The default is to start reading the first valid log record found in the earliest file found.
-ttimeline--timeline=timelineTimeline from which to read log records. The default is to use the value in
startseg, if that is specified; otherwise, the default is 1.-V--versionPrint the pg_xlogdump version and exit.
-xxid--xid=xidOnly 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.
-?--helpShow help about pg_xlogdump command line arguments, and exit.
Notes
Can give wrong results when the server is running.
Only the specified timeline is displayed (or the default, if none is specified). Records in other timelines are ignored.
pg_xlogdump cannot read WAL files with suffix .partial. If those files need to be read, .partial suffix needs to be removed from the file name.