pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: ow <oneway_111@yahoo.com>
Cc: scott.marlowe <scott.marlowe@ihs.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Taking database offline
Date: Thu, 13 Nov 2003 11:20:00 -0500 (EST)
Message-ID: <200311131620.hADGK0l24065@candle.pha.pa.us> (raw)
In-Reply-To: <20031113155021.46917.qmail@web21407.mail.yahoo.com>

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



view thread (12+ messages)

Message-ID: <200311131620.hADGK0l24065@candle.pha.pa.us>
Permalink:  ../200311131620.hADGK0l24065@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200311131620.hADGK0l24065@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: pgman@candle.pha.pa.us, oneway_111@yahoo.com, scott.marlowe@ihs.com
  Subject: Re: Taking database offline
  In-Reply-To: <200311131620.hADGK0l24065@candle.pha.pa.us>
  References: <20031113155021.46917.qmail@web21407.mail.yahoo.com> <200311131620.hADGK0l24065@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox