vijaysam@mailworks.org wrote:
> But, when I try to kill -9 the master server main postgres process. The
> client code from java is able to continue to write to the postgres db which
> was the old master as there was a connection established to this server and
> the connection keeps allowing write to happen as thought the server is still
> running. I understand kill -9 is a bad thing.
Good thing that you do. Don't do it, as it's not a proper shutdown
procedure. There are three documented signals with varying degrees of
shutdown immediacy: SIGTERM, SIGINT, SIGQUIT. The postmaster process
will take action to terminate server processes as appropriate if you use
those signals. SIGKILL is entirely inappropriate. If you would like to
use SIGKILL, you need to send it to *all* postgres processes, which will
cause a shutdown very similar in nature to SIGQUIT.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services