From c25b4dbf03a9b9e5bf79f2f7e2bcdcd9dc6263b9 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 25 Nov 2000 17:17:30 +0000 Subject: Update pg_ctl ref page, help output, messages. Some repair to work better with current postmaster. --- doc/src/sgml/ref/pg_ctl-ref.sgml | 345 +++++++++++++++------------------------ 1 file changed, 132 insertions(+), 213 deletions(-) (limited to 'doc/src/sgml/ref') diff --git a/doc/src/sgml/ref/pg_ctl-ref.sgml b/doc/src/sgml/ref/pg_ctl-ref.sgml index 4fc37312eaf..8d7e3eac139 100644 --- a/doc/src/sgml/ref/pg_ctl-ref.sgml +++ b/doc/src/sgml/ref/pg_ctl-ref.sgml @@ -1,42 +1,76 @@ + + 2000-11-25 + + - - pg_ctl - + pg_ctl + 1 Application - - pg_ctl - - - Starts, stops, and restarts postmaster - + pg_ctl + Starts, stops, or restarts postmaster - - 2000-04-05 - - - -pg_ctl [-w] [-D datadir][-p path] [-o "options"] start -pg_ctl [-w] [-D datadir] [-m [s[mart]|f[ast]|i[mmediate]]] stop -pg_ctl [-w] [-D datadir] [-m [s[mart]|f[ast]|i[mmediate]] - [-o "options"] restart -pg_ctl [-D datadir] status - - - - - Inputs - + + pg_ctl + start + -w + -D datadir + -p path + -o options + + pg_ctl + stop + -w + -D datadir + -m + + s[mart] + f[ast] + i[mmediate] + + + + pg_ctl + restart + -w + -D datadir + -m + + s[mart] + f[ast] + i[mmediate] + + + -o options + + pg_ctl + status + -D datadir + + + + + + Description + + pg_ctl is a utility for starting, + stopping, or restarting the , or displaying the status of a + running postmaster. + + + + Options @@ -44,8 +78,9 @@ pg_ctl [-D datadir] status -w - Wait for the database server to come up, by - watching for creation of the pid file (PGDATA/postmaster.pid). + Wait for the database server to come up, by watching for + creation of the pid file + (PGDATA/postmaster.pid). Times out after 60 seconds. @@ -55,7 +90,9 @@ pg_ctl [-D datadir] status -D datadir - Specifies the database location for this database installation. + Specifies the file system location of the database files. If + this is omitted, the environment variable + PGDATA is used. @@ -64,13 +101,18 @@ pg_ctl [-D datadir] status -p path - Specifies the path to the postmaster image. + Specifies the location of the postmaster + executable. By default the postmaster is taken from the same + directory as pg_ctl, or failing that, the hard-wired + installation directory. It is not necessary to use this + option unless you are doing something unusual and get errors + that the postmaster was not found. - -o "options" + -o options Specifies options to be passed directly to @@ -95,8 +137,8 @@ pg_ctl [-D datadir] status s - smart mode waits for all - the clients to logout. This is the default. + Smart mode waits for all the clients to disconnect. This + is the default. @@ -106,8 +148,8 @@ pg_ctl [-D datadir] status f - Fast mode sends SIGTERM to the backends; that means - active transactions get rolled back. + Fast mode does not wait for clients to disconnect. All + active transactions will be rolled back. @@ -117,9 +159,8 @@ pg_ctl [-D datadir] status i - Immediate mode sends SIGUSR1 - to the backends and lets them abort. In this case, database recovery - will be necessary on the next start-up. + Immediate mode will abort without complete shutdown. This + will lead to a recovery run on restart. @@ -150,8 +191,8 @@ pg_ctl [-D datadir] status restart - Restart the postmaster, performing - a stop/start sequence. + Stop the postmaster, if one is running, + and then start it again. @@ -168,229 +209,107 @@ pg_ctl [-D datadir] status - - - 1999-11-07 - - - Outputs - - - - - pg_ctl: postmaster is state (pid: #) - - - Postmaster status. - - - - + + Files - If there is an error condition, the backend error message will be displayed. + + If the file postmaster.opts.default exists in + the data directory, the contents of the file will be passed as + options to the postmaster, unless + overridden by the option. - - - - Description - - - pg_ctl is a utility for starting, - stopping or restarting postmaster. - + - - Usage - + Usage - - Starting postmaster - + Starting the postmaster To start up postmaster: - - -$ pg_ctl start - + +$ pg_ctl start + - If -w is supplied, pg_ctl waits for the database server to come up, by - watching for creation of the pid file (PGDATA/postmaster.pid), for up - to 60 seconds. - - - - Parameters to invoke postmaster are - taken from the following sources: - - - - - Path to postmaster: found in the command search path. - - - - - - Database directory: PGDATA environment variable. - - - - - - Other parameters: - PGDATA/postmaster.opts.default. - - - - - - - postmaster.opts.default contains parameters - for postmaster. - - - - Note that postmaster.opts.default is - installed by initdb from - lib/postmaster.opts.default.sample - under the Postgres installation - directory (lib/postmaster.opts.default.sample - is copied from - src/bin/pg_ctl/postmaster.opts.default.sample - while installing Postgres). - - - - To override the default parameters you can use , - and options. - - - - An example of starting the - postmaster, blocking until - postmaster comes up is: - -$ pg_ctl -w start - - - - - To specify the postmaster binary path, - try: - - -$ pg_ctl -p /usr/local/pgsql/bin/postmaster start - + An example of starting the postmaster, + blocking until postmaster comes up is: + +$ pg_ctl -w start + For a postmaster using port 5433, and running without fsync, use: - - -$ pg_ctl -o "-o -F -p 5433" start - + +$ pg_ctl -o "-F -p 5433" start + - - Stopping postmaster - + Stopping the postmaster - - -$ pg_ctl stop - - + +$ pg_ctl stop + stops postmaster. Using the switch allows one to control how the backend shuts down. - - waits for postmaster to shut down. - specifies the shut down mode. + waits for postmaster to shut down. - - Restarting postmaster - + Restarting the postmaster This is almost equivalent to stopping the - postmaster then starting it - again except that the parameters used before stopping - it would be used too. This is done by saving them in - $PGDATA/postmaster.opts file. - , , , - , and - - can also be used in the restarting mode and they have the same meanings as - described above. - - - - To restart postmaster in the simplest - form: - - -$ pg_ctl restart - + postmaster then starting it again + except that pg_ctl saves and reuses the command line options that + were passed to the previously running instance. To restart + postmaster in the simplest form: + +$ pg_ctl restart + To restart postmaster, waiting for it to shut down and to come up: - - -$ pg_ctl -w restart - + +$ pg_ctl -w restart + To restart using port 5433 and disabling fsync after restarting: - - -$ pg_ctl -o "-o -F -p 5433" restart - + +$ pg_ctl -o "-F -p 5433" restart + - - postmaster status - + Showing postmaster status - To get status information from postmaster: - - -$ pg_ctl status - - - - - Here is a sample output from pg_ctl: - - + Here is a sample status output from + pg_ctl: + +$ pg_ctl status + pg_ctl: postmaster is running (pid: 13718) -options are: -/usr/local/src/pgsql/current/bin/postmaster --p 5433 --D /usr/local/src/pgsql/current/data --B 64 --b /usr/local/src/pgsql/current/bin/postgres --N 32 --o '-F' - +Command line was: +/usr/local/pgsql/bin/postmaster '-D' '/usr/local/pgsql/data' '-p' '5433' '-B' '128' + + + This is the command line that would be invoked in restart mode. -- cgit v1.2.3