| Server IP : 104.21.25.180 / Your IP : 162.159.115.42 Web Server : Apache/2.4.37 System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : ricodeal ( 1046) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/postgresql-docs/html/ |
Upload File : |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>pg_waldump</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="[email protected]" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="pgupgrade.html" title="pg_upgrade" /><link rel="next" href="app-postgres.html" title="postgres" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center"><span xmlns="http://www.w3.org/1999/xhtml" class="application">pg_waldump</span></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgupgrade.html" title="pg_upgrade">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-server.html" title="PostgreSQL Server Applications">Up</a></td><th width="60%" align="center">PostgreSQL Server Applications</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 10.23 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="app-postgres.html" title="postgres">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="PGWALDUMP"><div class="titlepage"></div><a id="id-1.9.5.12.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_waldump</span></span></h2><p>pg_waldump — display a human-readable rendering of the write-ahead log of a <span class="productname">PostgreSQL</span> database cluster</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p id="id-1.9.5.12.4.1"><code class="command">pg_waldump</code> [<code class="option">option</code>...] [<code class="option">startseg</code>
[<code class="option">endseg</code>]
]</p></div></div><div class="refsect1" id="R1-APP-PGWALDUMP-1"><h2>Description</h2><p> <code class="command">pg_waldump</code> displays the write-ahead log (WAL) and is mainly
useful for debugging or educational purposes.
</p><p> This utility can only be run by the user who installed the server, because
it requires read-only access to the data directory.
</p></div><div class="refsect1" id="id-1.9.5.12.6"><h2>Options</h2><p> The following command-line options control the location and format of the
output:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>startseg</code></em></span></dt><dd><p> 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.
</p></dd><dt><span class="term"><em class="replaceable"><code>endseg</code></em></span></dt><dd><p> Stop after reading the specified log segment file.
</p></dd><dt><span class="term"><code class="option">-b</code><br /></span><span class="term"><code class="option">--bkp-details</code></span></dt><dd><p> Output detailed information about backup blocks.
</p></dd><dt><span class="term"><code class="option">-e <em class="replaceable"><code>end</code></em></code><br /></span><span class="term"><code class="option">--end=<em class="replaceable"><code>end</code></em></code></span></dt><dd><p> Stop reading at the specified WAL location, instead of reading to the
end of the log stream.
</p></dd><dt><span class="term"><code class="option">-f</code><br /></span><span class="term"><code class="option">--follow</code></span></dt><dd><p> After reaching the end of valid WAL, keep polling once per second for
new WAL to appear.
</p></dd><dt><span class="term"><code class="option">-n <em class="replaceable"><code>limit</code></em></code><br /></span><span class="term"><code class="option">--limit=<em class="replaceable"><code>limit</code></em></code></span></dt><dd><p> Display the specified number of records, then stop.
</p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>path</code></em></code><br /></span><span class="term"><code class="option">--path=<em class="replaceable"><code>path</code></em></code></span></dt><dd><p> Specifies a directory to search for log segment files or a
directory with a <code class="literal">pg_wal</code> subdirectory that
contains such files. The default is to search in the current
directory, the <code class="literal">pg_wal</code> subdirectory of the
current directory, and the <code class="literal">pg_wal</code> subdirectory
of <code class="envar">PGDATA</code>.
</p></dd><dt><span class="term"><code class="option">-r <em class="replaceable"><code>rmgr</code></em></code><br /></span><span class="term"><code class="option">--rmgr=<em class="replaceable"><code>rmgr</code></em></code></span></dt><dd><p> Only display records generated by the specified resource manager.
If <code class="literal">list</code> is passed as name, print a list of valid resource manager
names, and exit.
</p></dd><dt><span class="term"><code class="option">-s <em class="replaceable"><code>start</code></em></code><br /></span><span class="term"><code class="option">--start=<em class="replaceable"><code>start</code></em></code></span></dt><dd><p> WAL location at which to start reading. The default is to start reading
the first valid log record found in the earliest file found.
</p></dd><dt><span class="term"><code class="option">-t <em class="replaceable"><code>timeline</code></em></code><br /></span><span class="term"><code class="option">--timeline=<em class="replaceable"><code>timeline</code></em></code></span></dt><dd><p> Timeline from which to read log records. The default is to use the
value in <em class="replaceable"><code>startseg</code></em>, if that is specified; otherwise, the
default is 1.
</p></dd><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p> Print the <span class="application">pg_waldump</span> version and exit.
</p></dd><dt><span class="term"><code class="option">-x <em class="replaceable"><code>xid</code></em></code><br /></span><span class="term"><code class="option">--xid=<em class="replaceable"><code>xid</code></em></code></span></dt><dd><p> Only display records marked with the given transaction ID.
</p></dd><dt><span class="term"><code class="option">-z</code><br /></span><span class="term"><code class="option">--stats[=record]</code></span></dt><dd><p> 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.
</p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p> Show help about <span class="application">pg_waldump</span> command line
arguments, and exit.
</p></dd></dl></div><p>
</p></div><div class="refsect1" id="id-1.9.5.12.7"><h2>Notes</h2><p> Can give wrong results when the server is running.
</p><p> Only the specified timeline is displayed (or the default, if none is
specified). Records in other timelines are ignored.
</p><p> <span class="application">pg_waldump</span> cannot read WAL files with suffix
<code class="literal">.partial</code>. If those files need to be read, <code class="literal">.partial</code>
suffix needs to be removed from the file name.
</p></div><div class="refsect1" id="id-1.9.5.12.8"><h2>See Also</h2><span class="simplelist"><a class="xref" href="wal-internals.html" title="30.5. WAL Internals">Section 30.5</a></span></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgupgrade.html" title="pg_upgrade">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-server.html" title="PostgreSQL Server Applications">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="app-postgres.html" title="postgres">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span xmlns="http://www.w3.org/1999/xhtml" class="application">pg_upgrade</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 10.23 Documentation">Home</a></td><td width="40%" align="right" valign="top"> <span xmlns="http://www.w3.org/1999/xhtml" class="application">postgres</span></td></tr></table></div></body></html>