summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-12-27 08:27:53 +0900
committerMichael Paquier <michael@paquier.xyz>2022-12-27 08:27:53 +0900
commitd497093cbecccf6df26365e06a5f8f8614b591c8 (patch)
tree780287104c70621c27a5e43333c6d75e7b69075f /doc/src
parent5de94a041ed7a51b571db2030ba87600c7fc6262 (diff)
pg_waldump: Add --save-fullpage=PATH to save full page images from WAL records
This option extracts (potentially decompressing) full-page images included in WAL records into a given target directory. These images are subject to the same filtering rules as the normal display of the WAL records, hence with --relation one can for example extract only the FPIs issued on the relation defined. By default, the records are printed or their stats computed (--stats), using --quiet would only save the images without any output generated. This is a tool aimed mostly for very experienced users, useful for fixing page-level corruption or just analyzing the past state of a page, and there were no easy way to do that with the in-core tools up to now when looking at WAL. Each block is saved in a separate file, to ease their manipulation, with the file respecting <lsn>.<ts>.<db>.<rel>.<blk>_<fork> with as format. For instance, 00000000-010000C0.1663.1.6117.123_main refers to: - WAL record LSN in hexa format (00000000-010000C0). - Tablespace OID (1663). - Database OID (1). - Relfilenode (6117). - Block number (123). - Fork name of the file this block came from (_main). Author: David Christensen Reviewed-by: Sho Kato, Justin Pryzby, Bharath Rupireddy, Matthias van de Meent Discussion: https://postgr.es/m/CAOxo6XKjQb2bMSBRpePf3ZpzfNTwjQUc4Tafh21=jzjX6bX8CA@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/pg_waldump.sgml66
1 files changed, 66 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/pg_waldump.sgml b/doc/src/sgml/ref/pg_waldump.sgml
index d559f091e5f..343f0482a9f 100644
--- a/doc/src/sgml/ref/pg_waldump.sgml
+++ b/doc/src/sgml/ref/pg_waldump.sgml
@@ -241,6 +241,72 @@ PostgreSQL documentation
</varlistentry>
<varlistentry>
+ <term><option>--save-fullpage=<replaceable>save_path</replaceable></option></term>
+ <listitem>
+ <para>
+ Save full page images found in the WAL records to the
+ <replaceable>save_path</replaceable> directory. The images saved
+ are subject to the same filtering and limiting criteria as the
+ records displayed.
+ </para>
+ <para>
+ The full page images are saved with the following file name format:
+ <literal><replaceable>LSN</replaceable>.<replaceable>RELTABLESPACE</replaceable>.<replaceable>DATOID</replaceable>.<replaceable>RELNODE</replaceable>.<replaceable>BLKNO</replaceable><replaceable>FORK</replaceable></literal>
+
+ The file names are composed of the following parts:
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Component</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>LSN</entry>
+ <entry>The <acronym>LSN</acronym> of the record with this image,
+ formatted as two 8-character hexadecimal numbers
+ <literal>%08X-%08X</literal></entry>
+ </row>
+
+ <row>
+ <entry>RELTABLESPACE</entry>
+ <entry>tablespace OID of the block</entry>
+ </row>
+
+ <row>
+ <entry>DATOID</entry>
+ <entry>database OID of the block</entry>
+ </row>
+
+ <row>
+ <entry>RELNODE</entry>
+ <entry>filenode of the block</entry>
+ </row>
+
+ <row>
+ <entry>BLKNO</entry>
+ <entry>block number of the block</entry>
+ </row>
+
+ <row>
+ <entry>FORK</entry>
+ <entry>
+ The name of the fork the full page image came from, as of
+ <literal>_main</literal>, <literal>_fsm</literal>,
+ <literal>_vm</literal>, or <literal>_init</literal>.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-x <replaceable>xid</replaceable></option></term>
<term><option>--xid=<replaceable>xid</replaceable></option></term>
<listitem>