11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_resetxlog.sgml,v 1.10 2005/04/28 21:47:10 tgl Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/pg_resetxlog.sgml,v 1.11 2005/06/08 15:50:21 tgl Exp $
33PostgreSQL documentation
44-->
55
@@ -23,6 +23,7 @@ PostgreSQL documentation
2323 <arg> -o <replaceable class="parameter">oid</replaceable> </arg>
2424 <arg> -x <replaceable class="parameter">xid</replaceable> </arg>
2525 <arg> -m <replaceable class="parameter">mxid</replaceable> </arg>
26+ <arg> -O <replaceable class="parameter">mxoff</replaceable> </arg>
2627 <arg> -l <replaceable class="parameter">timelineid</replaceable>,<replaceable class="parameter">fileid</replaceable>,<replaceable class="parameter">seg</replaceable> </arg>
2728 <arg choice="plain"><replaceable>datadir</replaceable></arg>
2829 </cmdsynopsis>
@@ -32,8 +33,8 @@ PostgreSQL documentation
3233 <title>Description</title>
3334 <para>
3435 <command>pg_resetxlog</command> clears the write-ahead log (WAL) and
35- optionally resets some other control information( stored in the
36- <filename>pg_control</> file) . This function is sometimes needed
36+ optionally resets some other control information stored in the
37+ <filename>pg_control</> file. This function is sometimes needed
3738 if these files have become corrupted. It should be used only as a
3839 last resort, when the server will not start due to such corruption.
3940 </para>
@@ -60,8 +61,9 @@ PostgreSQL documentation
6061 by specifying the <literal>-f</> (force) switch. In this case plausible
6162 values will be substituted for the missing data. Most of the fields can be
6263 expected to match, but manual assistance may be needed for the next OID,
63- next transaction ID, WAL starting address, and database locale fields.
64- The first three of these can be set using the switches discussed below.
64+ next transaction ID, next multi-transaction ID and offset,
65+ WAL starting address, and database locale fields.
66+ The first five of these can be set using the switches discussed below.
6567 <command>pg_resetxlog</command>'s own environment is the source for its
6668 guess at the locale fields; take care that <envar>LANG</> and so forth
6769 match the environment that <command>initdb</> was run in.
@@ -74,9 +76,10 @@ PostgreSQL documentation
7476 </para>
7577
7678 <para>
77- The <literal>-o</>, <literal>-x</>, <literal>-m</>, and <literal>-l</>
79+ The <literal>-o</>, <literal>-x</>, <literal>-m</>, <literal>-O</>,
80+ and <literal>-l</>
7881 switches allow the next OID, next transaction ID, next multi-transaction
79- ID, and WAL starting address values to
82+ ID,next multi-transaction offset, and WAL starting address values to
8083 be set manually. These are only needed when
8184 <command>pg_resetxlog</command> is unable to determine appropriate values
8285 by reading <filename>pg_control</>. Safe values may be determined as
@@ -108,6 +111,17 @@ PostgreSQL documentation
108111 </para>
109112 </listitem>
110113
114+ <listitem>
115+ <para>
116+ A safe value for the next multi-transaction offset (<literal>-O</>)
117+ may be determined by looking for the numerically largest
118+ file name in the directory <filename>pg_multixact/members</> under the
119+ data directory, adding one, and then multiplying by 65536. As above,
120+ the file names are in hexadecimal, so the easiest way to do this is to
121+ specify the switch value in hexadecimal and add four zeroes.
122+ </para>
123+ </listitem>
124+
111125 <listitem>
112126 <para>
113127 The WAL starting address (<literal>-l</>) should be