doc: Reorganize pg_resetxlog reference page
authorPeter Eisentraut
Mon, 29 Feb 2016 23:48:34 +0000 (18:48 -0500)
committerPeter Eisentraut
Thu, 10 Mar 2016 02:26:06 +0000 (21:26 -0500)
The pg_resetxlog reference page didn't have a proper options list, only
running text listing the options and some explanations of them.  This
might have worked when there were only a few options, but the list has
grown over the releases, and now it's hard to find an option and its
associated explanation.  So write out the options list as on other
reference pages.

doc/src/sgml/ref/pg_resetxlog.sgml

index 1bcc5a7ff0382abeef833841f12b534d270f384c..fd9d0be6f44c40a567d69896dbe934bb069bf076 100644 (file)
@@ -22,15 +22,9 @@ PostgreSQL documentation
  
   
    pg_resetxlog
-    xid,xid
    
    
-    oid
-    xid
-    xid_epoch
-    mxid,mxid
-    mxoff
-    xlogfile
+   option
     datadir
   
  
@@ -76,78 +70,108 @@ PostgreSQL documentation
    execute any data-modifying operations in the database before you dump,
    as any such action is likely to make the corruption worse.
   
 
-  
-   The 
-   
-   
-   and 
-   options allow the next OID, next transaction ID, next transaction ID's
-   epoch, next and oldest multitransaction ID, next multitransaction offset,
-   oldest and newest transaction IDs for which the commit time can be retrieved,
-   and WAL
-   starting address values to be set manually.  These are only needed when
-   pg_resetxlog is unable to determine appropriate values
-   by reading pg_control.  Safe values can be determined as
-   follows:
+  Options
 
-   
+  
+   
+    
     
      
-      A safe value for the next transaction ID (
-      can be determined by looking for the numerically largest
-      file name in the directory pg_clog under the data directory,
-      adding one,
-      and then multiplying by 1048576.  Note that the file names are in
-      hexadecimal.  It is usually easiest to specify the option value in
-      hexadecimal too. For example, if 0011 is the largest entry
-      in pg_clog, -x 0x1200000 will work (five
-      trailing zeroes provide the proper multiplier).
+      Force pg_resetxlog to proceed even if it cannot determine
+      valid data for pg_control, as explained above.
      
     
+   
 
+   
+    
     
      
-      A safe value for the next multitransaction ID (first part of 
-      can be determined by looking for the numerically largest
-      file name in the directory pg_multixact/offsets under the
-      data directory, adding one, and then multiplying by 65536.
-      Conversely, a safe value for the oldest multitransaction ID (second part of
-      
-      can be determined by looking for the numerically smallest
-      file name in the same directory and multiplying by 65536.
-      As above, the file names are in hexadecimal, so the easiest way to do
-      this is to specify the option value in hexadecimal and append four zeroes.
+      The 
+      pg_resetxlog to print the values reconstructed from
+      pg_control and values about to be changed, and then exit
+      without modifying anything. This is mainly a debugging tool, but can be
+      useful as a sanity check before allowing pg_resetxlog
+      to proceed for real.
      
     
+   
 
+   
+    
+    
+    Display version information, then exit.
+   
+
+   
+    
+    
+    Show help, then exit.
+   
+  
+
+  
+   The following options are only needed when
+   pg_resetxlog is unable to determine appropriate values
+   by reading pg_control.  Safe values can be determined as
+   described below.  For values that take numeric arguments, hexadecimal
+   values can be specified by using the prefix 0x.
+  
+
+  
+   
+     xid,xid
     
      
-      A safe value for the next multitransaction offset (
-      can be determined by looking for the numerically largest
-      file name in the directory pg_multixact/members under the
-      data directory, adding one, and then multiplying by 52352.  As above,
-      the file names are in hexadecimal.  There is no simple recipe such as
-      the ones above of appending zeroes.
+      Manually set the oldest and newest transaction IDs for which the commit
+      time can be retrieved.
      
-    
 
-    
      
       A safe value for the oldest transaction ID for which the commit time can
-      be retrieved (first part of ) can be determined by looking
+      be retrieved (first part) can be determined by looking
       for the numerically smallest file name in the directory
       pg_commit_ts under the data directory.  Conversely, a safe
       value for the newest transaction ID for which the commit time can be
-      retrieved (second part of 
-      the numerically greatest file name in the same directory.  As above, the
-      file names are in hexadecimal.
+      retrieved (second part) can be determined by looking for the numerically
+      greatest file name in the same directory.  The file names are in
+      hexadecimal.
      
     
+   
 
+   
+     xid_epoch
     
      
-      The WAL starting address (
+      Manually set the next transaction ID's epoch.
+     
+
+     
+      The transaction ID epoch is not actually stored anywhere in the database
+      except in the field that is set by pg_resetxlog,
+      so any value will work so far as the database itself is concerned.
+      You might need to adjust this value to ensure that replication
+      systems such as Slony-I and
+      Skytools work correctly —
+      if so, an appropriate value should be obtainable from the state of
+      the downstream replicated database.
+     
+    
+   
+
+   
+     xlogfile
+    
+     
+      Manually set the WAL starting address.
+     
+
+     
+      The WAL starting address should be
       larger than any WAL segment file name currently existing in
       the directory pg_xlog under the data directory.
       These names are also in hexadecimal and have three parts.  The first
@@ -168,46 +192,81 @@ PostgreSQL documentation
       
      
     
+   
+
+   
+     mxid,mxid
+    
+     
+      Manually set the next and oldest multitransaction ID.
+     
+
+     
+      A safe value for the next multitransaction ID (first part) can be
+      determined by looking for the numerically largest file name in the
+      directory pg_multixact/offsets under the data directory,
+      adding one, and then multiplying by 65536 (0x10000).  Conversely, a safe
+      value for the oldest multitransaction ID (second part of
+      
+      file name in the same directory and multiplying by 65536.  The file
+      names are in hexadecimal, so the easiest way to do this is to specify
+      the option value in hexadecimal and append four zeroes.
+     
+    
+   
 
+   
+     oid
     
+     
+      Manually set the next OID.
+     
+
      
       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.
      
     
+   
 
+   
+     mxoff
     
      
-      The transaction ID epoch is not actually stored anywhere in the database
-      except in the field that is set by pg_resetxlog,
-      so any value will work so far as the database itself is concerned.
-      You might need to adjust this value to ensure that replication
-      systems such as Slony-I and
-      Skytools work correctly —
-      if so, an appropriate value should be obtainable from the state of
-      the downstream replicated database.
+      Manually set the next multitransaction offset.
      
-    
-   
-  
 
-  
-   The 
-   pg_resetxlog to print the values reconstructed from
-   pg_control and values about to be changed, and then exit
-   without modifying anything. This is mainly a debugging tool, but can be
-   useful as a sanity check before allowing pg_resetxlog
-   to proceed for real.
-  
+     
+      A safe value can be determined by looking for the numerically largest
+      file name in the directory pg_multixact/members 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.
+     
+    
+   
 
-  >
-   The 
-   the pg_resetxlog version and exit.  The
-   options 
-   and exit.
-  
+   >
+     xid
+    
+     
+      Manually set the next transaction ID.
+     
 
+     
+      A safe value can be determined by looking for the numerically largest
+      file name in the directory pg_clog 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 0011 is the largest entry
+      in pg_clog, -x 0x1200000 will work (five
+      trailing zeroes provide the proper multiplier).
+     
+    
+   
+  
  
 
  
@@ -224,4 +283,11 @@ PostgreSQL documentation
   
  
 
+  See Also
+
+  
+   
+