summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2021-07-26 22:38:14 -0400
committerBruce Momjian <bruce@momjian.us>2021-07-26 22:38:14 -0400
commit0a5e708e2bd87adb0779d7c8758e5743cc1c0adf (patch)
treedaa4b3447aa38d93a87ea6d70f0b0238296c5633 /doc/src
parent882d15144bbb21856676ff046faee1e9a580e3e4 (diff)
pg_resetxlog: add option to set oldest xid & use by pg_upgrade
Add pg_resetxlog -u option to set the oldest xid in pg_control. Previously -x set this value be -2 billion less than the -x value. However, this causes the server to immediately scan all relation's relfrozenxid so it can advance pg_control's oldest xid to be inside the autovacuum_freeze_max_age range, which is inefficient and might disrupt diagnostic recovery. pg_upgrade will use this option to better create the new cluster to match the old cluster. Reported-by: Jason Harvey, Floris Van Nee Discussion: https://postgr.es/m/20190615183759.GB239428@rfd.leadboat.com, 87da83168c644fd9aae38f546cc70295@opammb0562.comp.optiver.com Author: Bertrand Drouvot Backpatch-through: 9.6
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/pg_resetwal.sgml20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/pg_resetwal.sgml b/doc/src/sgml/ref/pg_resetwal.sgml
index b3b750e722a..3e4882cdc65 100644
--- a/doc/src/sgml/ref/pg_resetwal.sgml
+++ b/doc/src/sgml/ref/pg_resetwal.sgml
@@ -298,6 +298,26 @@ PostgreSQL documentation
</varlistentry>
<varlistentry>
+ <term><option>-u <replaceable class="parameter">xid</replaceable></option></term>
+ <term><option>--oldest-transaction-id=<replaceable class="parameter">xid</replaceable></option></term>
+ <listitem>
+ <para>
+ Manually set the oldest unfrozen transaction ID.
+ </para>
+
+ <para>
+ A safe value can be determined by looking for the numerically smallest
+ file name in the directory <filename>pg_xact</filename> under the data directory
+ and then multiplying by 1048576 (0x100000). Note that the file names are in
+ hexadecimal. It is usually easiest to specify the option value in
+ hexadecimal too. For example, if <filename>0007</filename> is the smallest entry
+ in <filename>pg_xact</filename>, <literal>-u 0x700000</literal> will work (five
+ trailing zeroes provide the proper multiplier).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-x <replaceable class="parameter">xid</replaceable></option></term>
<term><option>--next-transaction-id=<replaceable class="parameter">xid</replaceable></option></term>
<listitem>