Re: Taking database offline - Mailing list pgsql-admin

From Bruce Momjian
Subject Re: Taking database offline
Date
Msg-id 200311131620.hADGK0l24065@candle.pha.pa.us
Whole thread Raw
In response to Re: Taking database offline  (ow <oneway_111@yahoo.com>)
List pgsql-admin
ow wrote:
>
> --- Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> > No, I guess that is the problem.  You can use restart, which will kick
> > everyone out, or you can use reload, but that doesn't kick people out of
> > the single database you want.
> >
>
> Restarting the db server triggers the whole chain of events: other dbs are
> affected, app servers will also need to restarted, and that has to be done
> twice (change pg_hba.conf and then reverse). There's got to be a better way.

OK, use reload, then use 'ps' to see the people connected to the
database and send a signal to the backend to for it to exit --- this is
how the postmaster does it.

Signals to use from the 7.4 postgres manual:

  <para>
   The <command>postmaster</command> uses <literal>SIGTERM</literal>
   to tell a <command>postgres</command> process to quit normally and
   <literal>SIGQUIT</literal> to terminate without the normal cleanup.
   These signals <emphasis>should not</emphasis> be used by users.  It is also
   unwise to send <literal>SIGKILL</literal> to a <command>postgres</command>
   process --- the <command>postmaster</command> will interpret this as
   a crash in <command>postgres</command>, and will force all the sibling
   <command>postgres</command> processes to quit as part of its standard
   crash-recovery procedure.
  </para>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-admin by date:

Previous
From: "Telecontrol Networking"
Date:
Subject: Re: can't connect to PostgreSQL Database using pgAdminII
Next
From: Markus Espenhain
Date:
Subject: SQL-Statement