Home Explore Blog CI



postgresql

5th chunk of `doc/src/sgml/ref/pg_resetwal.sgml`
5e3db3a1add64f1e2ece72f9a3b2a58b4aaf81d62107441e0000000100000c5c
 class="parameter">oid</replaceable></option></term>
    <listitem>
     <para>
      Manually set the next OID.
     </para>

     <para>
      There is no comparably easy way to determine a next OID that's beyond
      the largest one in the database, but fortunately it is not critical to
      get the next-OID setting right.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><option>-O <replaceable class="parameter">mxoff</replaceable></option></term>
    <term><option>--multixact-offset=<replaceable class="parameter">mxoff</replaceable></option></term>
    <listitem>
     <para>
      Manually set the next multitransaction offset.
     </para>

     <para>
      A safe value can be determined by looking for the numerically largest
      file name in the directory <filename>pg_multixact/members</filename> under the
      data directory, adding one, and then multiplying by 52352 (0xCC80).
      The file names are in hexadecimal.  There is no simple recipe such as
      the ones for other options of appending zeroes.
     </para>
     <!-- 52352 = SLRU_PAGES_PER_SEGMENT * floor(BLCKSZ/20) * 4; see multixact.c -->
    </listitem>
   </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>
     <!-- 1048576 = SLRU_PAGES_PER_SEGMENT * BLCKSZ * CLOG_XACTS_PER_BYTE -->
    </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>
     <para>
      Manually set the next transaction ID.
     </para>

     <para>
      A safe value can be determined by looking for the numerically largest
      file name in the directory <filename>pg_xact</filename> under the data directory,
      adding one,
      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>0011</filename> is the largest entry
      in <filename>pg_xact</filename>, <literal>-x 0x1200000</literal> will work (five
      trailing zeroes provide the proper multiplier).
     </para>
     <!-- 1048576 = SLRU_PAGES_PER_SEGMENT * BLCKSZ * CLOG_XACTS_PER_BYTE -->
    </listitem>

Title: pg_resetwal: Options Continued (OID, Multitransaction Offset, Oldest and Next Transaction IDs)
Summary
This section details further options for pg_resetwal, including manually setting the next OID (-o/--next-oid), noting that it is not critical to get this setting exactly right. It also explains how to manually set the next multitransaction offset (-O/--multixact-offset) by examining the largest file name in pg_multixact/members, and how to manually set the oldest unfrozen transaction ID (-u/--oldest-transaction-id) and the next transaction ID (-x/--next-transaction-id) by examining the smallest and largest file names in the pg_xact directory, respectively. Formulas and methods for calculating safe values are provided for each option.