"Poul L. Christiansen" <poulc@cs.auc.dk> writes:
> When I want to shutdown PostgreSQL, I use the command
> /etc/rc.d/init.d/postgresql stop
> But only pg_ctl and one postmaster stops :-(
"pg_ctl stop" performs a polite shutdown of the database --- ie,
existing clients are allowed to finish their sessions. The postmaster
stops accepting new connections, but doesn't quit until the last
active backend quits.
"pg_ctl -m fast stop" is probably what you are looking for: existing
clients are forcibly disconnected (with rollback of any open
transactions). If you have clients that will sit on open connections
indefinitely, this is the only way to shut down short of killing the
clients.
Dunno if this option can be passed through your
/etc/rc.d/init.d/postgresql script; the script may need some work.
> That means that I have to use the command "top" to see the other
> postmaster processes and kill them one by one.
As was just pointed out on pghackers, manually killing individual
backends is not merely tedious, it is dangerous. Avoid it.
regards, tom lane