1PG_WALDUMP(1) PostgreSQL 15.4 Documentation PG_WALDUMP(1)
2
3
4
6 pg_waldump - display a human-readable rendering of the write-ahead log
7 of a PostgreSQL database cluster
8
10 pg_waldump [option...] [startseg [endseg]]
11
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
20 The following command-line options control the location and format of
21 the output:
22
23 startseg
24 Start reading at the specified log segment file. This implicitly
25 determines the path in which files will be searched for, and the
26 timeline to use.
27
28 endseg
29 Stop after reading the specified log segment file.
30
31 -b
32 --bkp-details
33 Output detailed information about backup blocks.
34
35 -B block
36 --block=block
37 Only display records that modify the given block. The relation must
38 also be provided with --relation or -R.
39
40 -e end
41 --end=end
42 Stop reading at the specified WAL location, instead of reading to
43 the end of the log stream.
44
45 -f
46 --follow
47 After reaching the end of valid WAL, keep polling once per second
48 for new WAL to appear.
49
50 -F fork
51 --fork=fork
52 If provided, only display records that modify blocks in the given
53 fork. The valid values are main for the main fork, fsm for the free
54 space map, vm for the visibility map, and init for the init fork.
55
56 -n limit
57 --limit=limit
58 Display the specified number of records, then stop.
59
60 -p path
61 --path=path
62 Specifies a directory to search for log segment files or a
63 directory with a pg_wal subdirectory that contains such files. The
64 default is to search in the current directory, the pg_wal
65 subdirectory of the current directory, and the pg_wal subdirectory
66 of PGDATA.
67
68 -q
69 --quiet
70 Do not print any output, except for errors. This option can be
71 useful when you want to know whether a range of WAL records can be
72 successfully parsed but don't care about the record contents.
73
74 -r rmgr
75 --rmgr=rmgr
76 Only display records generated by the specified resource manager.
77 You can specify the option multiple times to select multiple
78 resource managers. If list is passed as name, print a list of valid
79 resource manager names, and exit.
80
81 Extensions may define custom resource managers, but pg_waldump does
82 not load the extension module and therefore does not recognize
83 custom resource managers by name. Instead, you can specify the
84 custom resource managers as custom### where "###" is the
85 three-digit resource manager ID. Names of this form will always be
86 considered valid.
87
88 -R tblspc/db/rel
89 --relation=tblspc/db/rel
90 Only display records that modify blocks in the given relation. The
91 relation is specified with tablespace OID, database OID, and
92 relfilenode separated by slashes, for example 1234/12345/12345.
93 This is the same format used for relations in the program's output.
94
95 -s start
96 --start=start
97 WAL location at which to start reading. The default is to start
98 reading the first valid log record found in the earliest file
99 found.
100
101 -t timeline
102 --timeline=timeline
103 Timeline from which to read log records. The default is to use the
104 value in startseg, if that is specified; otherwise, the default is
105 1.
106
107 -V
108 --version
109 Print the pg_waldump version and exit.
110
111 -w
112 --fullpage
113 Only display records that include full page images.
114
115 -x xid
116 --xid=xid
117 Only display records marked with the given transaction ID.
118
119 -z
120 --stats[=record]
121 Display summary statistics (number and size of records and
122 full-page images) instead of individual records. Optionally
123 generate statistics per-record instead of per-rmgr.
124
125 If pg_waldump is terminated by signal SIGINT (Control+C), the
126 summary of the statistics computed is displayed up to the
127 termination point. This operation is not supported on Windows.
128
129 -?
130 --help
131 Show help about pg_waldump command line arguments, and exit.
132
134 PGDATA
135 Data directory; see also the -p option.
136
137 PG_COLOR
138 Specifies whether to use color in diagnostic messages. Possible
139 values are always, auto and never.
140
142 Can give wrong results when the server is running.
143
144 Only the specified timeline is displayed (or the default, if none is
145 specified). Records in other timelines are ignored.
146
147 pg_waldump cannot read WAL files with suffix .partial. If those files
148 need to be read, .partial suffix needs to be removed from the file
149 name.
150
152 Section 30.6
153
154
155
156PostgreSQL 15.4 2023 PG_WALDUMP(1)