From 2132ac89bffaff331643c70ae1fcaba5a418e2b4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 17 Aug 2002 05:07:18 +0000 Subject: [PATCH] Editorial corrections. --- doc/src/sgml/ref/pg_controldata.sgml | 6 +-- doc/src/sgml/ref/pg_resetxlog.sgml | 80 ++++++++++++++++++---------- 2 files changed, 55 insertions(+), 31 deletions(-) diff --git a/doc/src/sgml/ref/pg_controldata.sgml b/doc/src/sgml/ref/pg_controldata.sgml index 7b4be8c968..2fa44e3c10 100644 --- a/doc/src/sgml/ref/pg_controldata.sgml +++ b/doc/src/sgml/ref/pg_controldata.sgml @@ -1,5 +1,5 @@ @@ -26,7 +26,7 @@ PostgreSQL documentation Description pg_controldata returns information initialized during - initdb. such as the catalog version and server encoding. + initdb, such as the catalog version and server locale. It also shows information about write-ahead logging and checkpoint processing. This information is server-wide, and not specific to any one database. @@ -49,7 +49,7 @@ PostgreSQL documentation - Default data direction location + Default data directory location diff --git a/doc/src/sgml/ref/pg_resetxlog.sgml b/doc/src/sgml/ref/pg_resetxlog.sgml index 2dedd712b1..ae3f97f177 100644 --- a/doc/src/sgml/ref/pg_resetxlog.sgml +++ b/doc/src/sgml/ref/pg_resetxlog.sgml @@ -1,5 +1,5 @@ @@ -12,13 +12,17 @@ PostgreSQL documentation pg_resetxlog - reset write-ahead log file and optionally the pg_controldata file + reset write-ahead log file and optionally the pg_control file pg_resetxlog - datadir + -f + -n + -x xid + -l fileid seg + datadir @@ -26,37 +30,51 @@ PostgreSQL documentation Description pg_resetxlog clears the write-ahead log file and - optionally the pg_controldata file. This is - used so the server can be started after these files have become corrupted. - (In every reported case, such file corruption has been caused - by faulty hardware.) It is to be used only as a last resort, + optionally the pg_control file. This function is sometimes + needed if these files have become corrupted. + It should be used only as a last resort, when the server will not start due to such corruption. - After running this command, the server may contain index corruption and - partially-committed transactions. You should immediately dump your data - and reload. After reload, check for partially committed transactions - that may have been open at the time of the server crash. + After running this command, it should be possible to start the server, + but bear in mind that the database may contain inconsistent data due to + partially-committed transactions. You should immediately dump your data, + run initdb, and reload. After reload, check for + inconsistencies and repair as needed. - pg_resetxlog can also fix a corrupted - pg_controldata file using the -f - flag. Use this option when pg_resetxlog reports it can't - reconstruct valid data for pg_control. - - - - pg_resetxlog has a few more options for - special purposes. Run the command with no arguments to see them. - - - - This utility can only be run by the user who installed the server because + This utility can only be run by the user who installed the server, because it requires read/write access to the datadir. - For safety reasons, you must specify the data directory on the command line. - It does not use the environment variable PGDATA. + For safety reasons, you must specify the data directory on the command line. + pg_resetxlog does not use the environment variable + PGDATA. + + + + If pg_resetxlog complains that it cannot determine + valid data for pg_control, you can force it to proceed anyway + by specifying the -f (force) switch. In this case plausible values + will be substituted for the missing data. If -f is used then + the recovered database must be treated with even more suspicion than + usual --- an immediate dump and reload is imperative. Do not + execute any data-modifying operations in the database before you dump, + as any such action is likely to make the corruption worse. + + + + The -n (no operation) switch instructs + pg_resetxlog to print the values reconstructed from + pg_control and then exit without modifying anything. + This is mainly a debugging tool, but may be useful as a sanity check + before allowing pg_resetxlog to proceed for real. + + + + The -x and -l switches are intended for use by + pg_upgrade. In most case they should not be used in + manual recovery operations. @@ -64,8 +82,14 @@ PostgreSQL documentation Notes - This command can not be used when the postmaster is - running. + This command must not be used when the postmaster is + running. pg_resetxlog will refuse to start up if + it finds a postmaster lock file in the datadir. If the + postmaster crashed then a lock file may have been left + behind; in that case you can remove the lock file to allow + pg_resetxlog to run. But before you do + so, make doubly certain that there + is no postmaster nor any backend server process still alive.