1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Improve command line options for pg_waldump.

Follow-up improvements for commit 127aea2a based on discussion:

* use fork name for --fork, not number
* use -R, -B as short switches for --relation, --block
* re-alphabetize the list of switches (code, --help and docs)

Suggested-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> (fork name part)
Reviewed-by: David Christensen <david.christensen@crunchydata.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Discussion: https://postgr.es/m/3a4c2e93-7976-2320-fc0a-32097fe148a7%40enterprisedb.com
This commit is contained in:
Thomas Munro
2022-03-25 13:44:10 +13:00
parent f28bf667f6
commit 52b5568432
2 changed files with 66 additions and 72 deletions

View File

@ -78,6 +78,18 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>-B <replaceable>block</replaceable></option></term>
<term><option>--block=<replaceable>block</replaceable></option></term>
<listitem>
<para>
Only display records that modify the given block. The relation must
also be provided with <option>--relation</option> or
<option>-l</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-e <replaceable>end</replaceable></option></term>
<term><option>--end=<replaceable>end</replaceable></option></term>
@ -100,41 +112,16 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>-k <replaceable>block</replaceable></option></term>
<term><option>--block=<replaceable>block</replaceable></option></term>
<listitem>
<para>
Only display records that modify the given block. The relation must
also be provided with <option>--relation</option> or
<option>-l</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-F <replaceable>fork</replaceable></option></term>
<term><option>--fork=<replaceable>fork</replaceable></option></term>
<listitem>
<para>
If provided, only display records that modify blocks in the given fork.
The valid values are <literal>0</literal> for the main fork,
<literal>1</literal> for the free space map,
<literal>2</literal> for the visibility map,
and <literal>3</literal> for the init fork.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-l <replaceable>tblspc</replaceable>/<replaceable>db</replaceable>/<replaceable>rel</replaceable></option></term>
<term><option>--relation=<replaceable>tblspc</replaceable>/<replaceable>db</replaceable>/<replaceable>rel</replaceable></option></term>
<listitem>
<para>
Only display records that modify blocks in the given relation. The
relation is specified with tablespace OID, database OID, and relfilenode
separated by slashes, for example <literal>1234/12345/12345</literal>.
This is the same format used for relations in the program's output.
The valid values are <literal>main</literal> for the main fork,
<literal>fsm</literal> for the free space map,
<literal>vm</literal> for the visibility map,
and <literal>init</literal> for the init fork.
</para>
</listitem>
</varlistentry>
@ -189,6 +176,19 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>-R <replaceable>tblspc</replaceable>/<replaceable>db</replaceable>/<replaceable>rel</replaceable></option></term>
<term><option>--relation=<replaceable>tblspc</replaceable>/<replaceable>db</replaceable>/<replaceable>rel</replaceable></option></term>
<listitem>
<para>
Only display records that modify blocks in the given relation. The
relation is specified with tablespace OID, database OID, and relfilenode
separated by slashes, for example <literal>1234/12345/12345</literal>.
This is the same format used for relations in the program's output.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-s <replaceable>start</replaceable></option></term>
<term><option>--start=<replaceable>start</replaceable></option></term>