Re: shutting down postmasters - Mailing list pgsql-general

From Tom Lane
Subject Re: shutting down postmasters
Date
Msg-id 1593.979062577@sss.pgh.pa.us
Whole thread Raw
In response to shutting down postmasters  ("Poul L. Christiansen" <poulc@cs.auc.dk>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: Lee Joramo
Date:
Subject: Re: COPY error: pqReadData() -- backend closed the channel unexpectedly
Next
From: Tom Lane
Date:
Subject: Re: Re: Loading optimization