PostgreSQL

PostgreSQL Elephant Logo

pg_waldump

pg_waldump — display a human-readable rendering of the write-ahead log of a PostgreSQL database cluster

Synopsis

pg_waldump [option…​] [startseg [endseg] ]

Description

pg_waldump 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:

`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.

`endseg`

Stop after reading the specified log segment file. [.term]#-b

[.term]--bkp-details#

Output detailed information about backup blocks. [.term]#`-e +`_`+end`_

[.term]--end=`end`#

Stop reading at the specified WAL location, instead of reading to the end of the log stream. [.term]#-f

[.term]--follow#

After reaching the end of valid WAL, keep polling once per second for new WAL to appear. [.term]#`-n +`_`+limit`_

[.term]--limit=`limit`#

Display the specified number of records, then stop. [.term]#`-p +`_`+path`_

[.term]--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. [.term]#`-r +`_`+rmgr`_

[.term]--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. [.term]#`-s +`_`+start`_

[.term]--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. [.term]#`-t +`_`+timeline`_

[.term]--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. [.term]#-V`

[.term]--version#

Print the pg_waldump version and exit. [.term]#`-x +`_`+xid`_

[.term]--xid=`xid`#

Only display records marked with the given transaction ID. [.term]#-z

[.term]--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. [.term]#-?

[.term]--help#

Show help about pg_waldump 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_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.

See Also


Prev Up Next

pg_upgrade

Home

postgres

Copyright © 1996-2023 The PostgreSQL Global Development Group