Database Reference
In-Depth Information
UBUNTU/DEBIAN
pg_ctlcluster 9.0 main reload
RED HAT/FEDORA
pg_ctl -D /var/lib/pgsql/data start
SOLARIS
pg_ctl -D /var/lib/pgsql/data start
MAC OS
pg_ctl -D /var/lib/pgsql/data start
FREEBSD
pg_ctl -D /var/lib/pgsql/data start
although on some platforms, the service can be started in various ways such as:
RED HAT/FEDORA
service postgresql start
WINDOWS
net start postgres
How it works...
On Ubuntu/Debian, the pg_ctlcluster wrapper is a convenient utility that allows multiple
servers to coexist more easily, which is especially good when you have servers with different
versions. Very useful.
Stopping the server safely and quickly
Let's do it!
How to do it...
You can issue a database server stop using fast mode as follows:
pg_ctl -D datadir -m fast stop
You must use -m fast if you wish to shut down as soon as possible. Normal shutdown means
"wait for all users to finish before we exit". That can take a very long time, though all the while
new connections are refused.
On other systems, this command might be as follows:
DEBIAN/UBUNTU
pg_ctlcluster 9.0 main stop --force
How it works...
When you do a fast stop, all users have their transactions aborted and all connections are
disconnected. It's not very polite to users, but it still treats the server and its data with care,
which is good.
PostgreSQL is similar to other database systems, in that it does do a shutdown checkpoint
before it closes. This means that the startup that follows will be quick and clean. The more
work the checkpoint has to do, the longer it will take to shut down.
 
Search WWH ::




Custom Search