4 pg_waldump — display a human-readable rendering of the write-ahead log
5 of a PostgreSQL database cluster
9 pg_waldump [option...] [startseg [endseg]]
13 pg_waldump displays the write-ahead log (WAL) and is mainly useful for
14 debugging or educational purposes.
16 This utility can only be run by the user who installed the server,
17 because it requires read-only access to the data directory.
21 The following command-line options control the location and format of
25 Start reading at the specified WAL segment file. This implicitly
26 determines the path in which files will be searched for, and the
30 Stop after reading the specified WAL segment file.
34 Output detailed information about backup blocks.
38 Only display records that modify the given block. The relation
39 must also be provided with --relation or -R.
43 Stop reading at the specified WAL location, instead of reading
44 to the end of the log stream.
48 After reaching the end of valid WAL, keep polling once per
49 second for new WAL to appear.
53 Only display records that modify blocks in the given fork. The
54 valid values are main for the main fork, fsm for the free space
55 map, vm for the visibility map, and init for the init fork.
59 Display the specified number of records, then stop.
63 Specifies a directory to search for WAL segment files or a
64 directory with a pg_wal subdirectory that contains such files.
65 The default is to search in the current directory, the pg_wal
66 subdirectory of the current directory, and the pg_wal
67 subdirectory of PGDATA.
71 Do not print any output, except for errors. This option can be
72 useful when you want to know whether a range of WAL records can
73 be successfully parsed but don't care about the record contents.
77 Only display records generated by the specified resource
78 manager. You can specify the option multiple times to select
79 multiple resource managers. If list is passed as name, print a
80 list of valid resource manager names, and exit.
82 Extensions may define custom resource managers, but pg_waldump
83 does not load the extension module and therefore does not
84 recognize custom resource managers by name. Instead, you can
85 specify the custom resource managers as custom### where ### is
86 the three-digit resource manager ID. Names of this form will
87 always be considered valid.
90 --relation=tblspc/db/rel
91 Only display records that modify blocks in the given relation.
92 The relation is specified with tablespace OID, database OID, and
93 relfilenode separated by slashes, for example 1234/12345/12345.
94 This is the same format used for relations in the program's
99 WAL location at which to start reading. The default is to start
100 reading the first valid WAL record found in the earliest file
105 Timeline from which to read WAL records. The default is to use
106 the value in startseg, if that is specified; otherwise, the
107 default is 1. The value can be specified in decimal or
108 hexadecimal, for example 17 or 0x11.
112 Print the pg_waldump version and exit.
116 Only display records that include full page images.
120 Only display records marked with the given transaction ID.
124 Display summary statistics (number and size of records and
125 full-page images) instead of individual records. Optionally
126 generate statistics per-record instead of per-rmgr.
128 If pg_waldump is terminated by signal SIGINT (Control+C), the
129 summary of the statistics computed is displayed up to the
130 termination point. This operation is not supported on Windows.
132 --save-fullpage=save_path
133 Save full page images found in the WAL records to the save_path
134 directory. The images saved are subject to the same filtering
135 and limiting criteria as the records displayed.
137 The full page images are saved with the following file name
138 format: TIMELINE-LSN.RELTABLESPACE.DATOID.RELNODE.BLKNO_FORK The
139 file names are composed of the following parts:
141 Component Description
142 TIMELINE The timeline of the WAL segment file where the record is
143 located formatted as one 8-character hexadecimal number %08X
144 LSN The LSN of the record with this image, formatted as two 8-character
145 hexadecimal numbers %08X-%08X
146 RELTABLESPACE tablespace OID of the block
147 DATOID database OID of the block
148 RELNODE filenode of the block
149 BLKNO block number of the block
150 FORK The name of the fork the full page image came from, such as main,
155 Show help about pg_waldump command line arguments, and exit.
160 Data directory; see also the -p option.
163 Specifies whether to use color in diagnostic messages. Possible
164 values are always, auto and never.
168 Can give wrong results when the server is running.
170 Only the specified timeline is displayed (or the default, if none is
171 specified). Records in other timelines are ignored.
173 pg_waldump cannot read WAL files with suffix .partial. If those files
174 need to be read, .partial suffix needs to be removed from the file