From: Tom Lane Date: Tue, 9 Nov 2010 19:05:11 +0000 (-0500) Subject: Improve pg_ctl's man page. X-Git-Tag: REL9_1_ALPHA3~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0de92fd13cc436c76fbbd4759c94e2d3623a6bf1;p=postgresql Improve pg_ctl's man page. Explicitly document that the -o options of pg_ctl init mode are meant for initdb, not postgres (Euler Taveira de Oliveira). Assorted other copy-editing (Tom). --- diff --git a/doc/src/sgml/ref/pg_ctl-ref.sgml b/doc/src/sgml/ref/pg_ctl-ref.sgml index 29bea24cdd..23fb00876e 100644 --- a/doc/src/sgml/ref/pg_ctl-ref.sgml +++ b/doc/src/sgml/ref/pg_ctl-ref.sgml @@ -25,7 +25,7 @@ PostgreSQL documentation init[db] -s -D datadir - -o options + -o initdb-options @@ -136,8 +136,7 @@ PostgreSQL documentation - The or mode creates a - new + The or mode creates a new PostgreSQL database cluster. A database cluster is a collection of databases that are managed by a single server instance. This mode invokes the initdb @@ -146,10 +145,10 @@ PostgreSQL documentation In mode, a new server is launched. The - server is started in the background, and standard input is attached + server is started in the background, and its standard input is attached to /dev/null (or nul on Windows). On Unix-like systems, by default, the server's standard output and - standard error are send to pg_ctl's + standard error are sent to pg_ctl's standard output (not standard error). The standard output of pg_ctl should then be redirected to a file or piped to another process such as a log rotating program @@ -157,24 +156,25 @@ PostgreSQL documentation will write its output to the controlling terminal (from the background) and will not leave the shell's process group. On Windows, by default the server's standard output and standard error - are sent to the terminal. These default behaviors can be changed - by using to append server output to a log file. + are sent to the terminal. These default behaviors can be changed + by using to append the server's output to a log file. + Use of either or output redirection is recommended. In mode, the server that is running in the specified data directory is shut down. Three different shutdown methods can be selected with the - option: Smart mode waits for online backup mode - to finish and all the clients to disconnect. This is the default. - If the server is in recovery, recovery and streaming replication + option. Smart mode (the default) waits for all active + clients to disconnect and any online backup to finish. + If the server is in hot standby, recovery and streaming replication will be terminated once all clients have disconnected. Fast mode does not wait for clients to disconnect and will terminate an online backup in progress. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down. Immediate mode will abort - all server processes without a clean shutdown. This will lead to - a recovery run on restart. + all server processes immediately, without a clean shutdown. + This will lead to a crash-recovery run on the next restart. @@ -203,7 +203,7 @@ PostgreSQL documentation mode allows you to send a signal to a specified process. This is particularly valuable for Microsoft Windows - which does not have a kill command. Use + which does not have a kill command. Use --help to see a list of supported signal names. @@ -211,12 +211,13 @@ PostgreSQL documentation mode allows you to register a system service on Microsoft Windows. The option allows selection of service start type, either auto (start - service automatically on system startup), on demand. + service automatically on system startup) or demand (start + service on demand). mode allows you to unregister a system service - on Microsoft Windows, previously registered with the + on Microsoft Windows. This undoes the effects of the command. @@ -231,9 +232,9 @@ PostgreSQL documentation Attempt to allow server crashes to produce core files, on platforms - where this available, by lifting any soft resource limit placed on - them. - This is useful in debugging or diagnosing problems by allowing a + where this is possible, by lifting any soft resource limit placed on + core files. + This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process. @@ -256,8 +257,8 @@ PostgreSQL documentation Append the server log output to filename. If the file does not - exist, it is created. The umask is set to 077, so access to - the log file from other users is disallowed by default. + exist, it is created. The umask is set to 077, + so access to the log file is disallowed to other users by default. @@ -282,7 +283,21 @@ PostgreSQL documentation postgres command. - The options are usually surrounded by single or double + The options should usually be surrounded by single or double + quotes to ensure that they are passed through as a group. + + + + + + + + + Specifies options to be passed directly to the + initdb command. + + + The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group. @@ -312,7 +327,7 @@ PostgreSQL documentation - Only print errors, no informational messages. + Print only errors, no informational messages. @@ -321,8 +336,8 @@ PostgreSQL documentation - The number of seconds to wait when waiting for start or shutdown - to complete. The default is 60 seconds. + The maximum number of seconds to wait when waiting for startup or + shutdown to complete. The default is 60 seconds. @@ -331,19 +346,22 @@ PostgreSQL documentation - Wait for the start or shutdown to complete. The default wait time - is 60 seconds but can be overridden with the option . - To wait is the default option for shutdowns. A successful - shutdown is indicated by removal of the PID - file. For starting up, a successful psql -l - indicates success. pg_ctl will attempt to - use the proper port for psql. If the environment variable - PGPORT exists, that is used. Otherwise, it will see if a port - has been set in the postgresql.conf file. - If neither of those is used, it will use the default port that - PostgreSQL was compiled with - (5432 by default). When waiting, pg_ctl will - return an accurate exit code based on the success of the startup + Wait for the startup or shutdown to complete. + Waiting is the default option for shutdowns, but not startups. + When waiting for shutdown, pg_ctl waits for + the server to remove its PID file. + When waiting for startup, pg_ctl repeatedly + attempts to connect to the server via psql, and + reports success when this is successful. + pg_ctl will attempt to use the proper port for + psql. If the environment variable + PGPORT exists, that is used. Otherwise, + pg_ctl will see if a port has been set in the + postgresql.conf file. If not, it will use the + default port that PostgreSQL was compiled + with (5432 by default). + When waiting, pg_ctl will + return an exit code based on the success of the startup or shutdown. @@ -353,8 +371,8 @@ PostgreSQL documentation - Do not wait for start or shutdown to complete. This is the - default for starts and restarts. + Do not wait for startup or shutdown to complete. This is the + default for start and restart modes. @@ -375,20 +393,20 @@ PostgreSQL documentation - + - Password for the user to start the service. + User name for the user to start the service. For domain users, use the + format DOMAIN\username. - + - User name for the user to start the service. For domain users, use the - format DOMAIN\username. + Password for the user to start the service. @@ -430,7 +448,7 @@ PostgreSQL documentation Default host name or Unix-domain socket location for (used by the option). + linkend="app-psql"> (used when waiting for startup). @@ -440,7 +458,8 @@ PostgreSQL documentation - Default port number for (used by the option). + Default port number for + (used when waiting for startup). @@ -448,10 +467,11 @@ PostgreSQL documentation - For additional server variables, see . - This utility, like most other PostgreSQL utilities, + pg_ctl, like most other PostgreSQL + utilities, also uses the environment variables supported by libpq (see ). + For additional server variables, see . @@ -477,10 +497,10 @@ PostgreSQL documentation If this file exists in the data directory, - pg_ctl (in mode) + pg_ctl (in mode) will pass the contents of the file as options to - postgres, unless overridden - by the option. The contents of this file + postgres, unless overridden + by the option. The contents of this file are also displayed in mode. @@ -492,8 +512,8 @@ PostgreSQL documentation This file, located in the data directory, is parsed to find the - proper port to use with psql when the - is given in mode. + proper port to use with psql + when waiting for startup. @@ -506,7 +526,7 @@ PostgreSQL documentation Notes - Waiting for complete start is not a well-defined operation and might + Waiting for complete startup is not a well-defined operation and might fail if access control is set up so that a local client cannot connect without manual interaction (e.g., password authentication). For additional connection variables, see , @@ -571,8 +591,8 @@ PostgreSQL documentation - To restart server, - waiting for it to shut down and to come up: + To restart the server, + waiting for it to shut down and come up again: $ pg_ctl -w restart