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
Pass this parameter to wait for the startup or shutdown of the database. Waiting will time out after 60 seconds.
Use this parameter to specify the location of the database directory for the database you are attempting to start. The environmental variable PGDATA is used if this is not given.
Use this option to supply the filesystem location of your postmaster binary file. This is usually not necessary.
Use this parameter to pass options directly to postmaster . Use single or double quotes to make sure they are passed as a group.
Use this parameter to set the shutdown mode, where mode is one of the following.
Smart mode waits for all the clients to logout. This is the default.
Fast mode sends SIGTERM to the backends, causing all active transactions to be rolled back.
Immediate mode sends SIGUSR1 to the backends and lets them abort. Database recovery will be necessary on the next startup when using this mode.
Use this parameter to start the database.
Use this parameter to shutdown postmaster.
Use this parameter to restart postmaster. This performs a shutdown and startup.
Use this parameter to display the current state of postmaster.
Use pg_ctl to start, stop, and restart postmaster. This program will look for the postmaster.opts.default file in the data directory and pass its contents on to postmaster, unless overridden by the -o option.
The following example starts postmaster using pg_ctl .
$ pg_ctl start
The next example stops postmaster using pg_ctl.
$ pg_ctl stop
The following example restarts postmaster.
$ pg_ctl restart