]> begriffs open source - ai-pg/blob - full-docs/txt/pgwaldump.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / pgwaldump.txt
1
2 pg_waldump
3
4    pg_waldump — display a human-readable rendering of the write-ahead log
5    of a PostgreSQL database cluster
6
7 Synopsis
8
9    pg_waldump [option...] [startseg [endseg]]
10
11 Description
12
13    pg_waldump displays the write-ahead log (WAL) and is mainly useful for
14    debugging or educational purposes.
15
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.
18
19 Options
20
21    The following command-line options control the location and format of
22    the output:
23
24    startseg
25           Start reading at the specified WAL segment file. This implicitly
26           determines the path in which files will be searched for, and the
27           timeline to use.
28
29    endseg
30           Stop after reading the specified WAL segment file.
31
32    -b
33           --bkp-details
34           Output detailed information about backup blocks.
35
36    -B block
37           --block=block
38           Only display records that modify the given block. The relation
39           must also be provided with --relation or -R.
40
41    -e end
42           --end=end
43           Stop reading at the specified WAL location, instead of reading
44           to the end of the log stream.
45
46    -f
47           --follow
48           After reaching the end of valid WAL, keep polling once per
49           second for new WAL to appear.
50
51    -F fork
52           --fork=fork
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.
56
57    -n limit
58           --limit=limit
59           Display the specified number of records, then stop.
60
61    -p path
62           --path=path
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.
68
69    -q
70           --quiet
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.
74
75    -r rmgr
76           --rmgr=rmgr
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.
81
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.
88
89    -R tblspc/db/rel
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
95           output.
96
97    -s start
98           --start=start
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
101           found.
102
103    -t timeline
104           --timeline=timeline
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.
109
110    -V
111           --version
112           Print the pg_waldump version and exit.
113
114    -w
115           --fullpage
116           Only display records that include full page images.
117
118    -x xid
119           --xid=xid
120           Only display records marked with the given transaction ID.
121
122    -z
123           --stats[=record]
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.
127
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.
131
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.
136
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:
140
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,
151    fsm, vm, or init.
152
153    -?
154           --help
155           Show help about pg_waldump command line arguments, and exit.
156
157 Environment
158
159    PGDATA
160           Data directory; see also the -p option.
161
162    PG_COLOR
163           Specifies whether to use color in diagnostic messages. Possible
164           values are always, auto and never.
165
166 Notes
167
168    Can give wrong results when the server is running.
169
170    Only the specified timeline is displayed (or the default, if none is
171    specified). Records in other timelines are ignored.
172
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
175    name.
176
177 See Also
178
179    Section 28.6