X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 595A0D1B557 for ; Thu, 13 Nov 2003 16:20:57 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62380-09 for ; Thu, 13 Nov 2003 12:20:25 -0400 (AST) Received: from candle.pha.pa.us (unknown [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 42DDDD1B51A for ; Thu, 13 Nov 2003 12:20:19 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id hADGK0l24065; Thu, 13 Nov 2003 11:20:00 -0500 (EST) From: Bruce Momjian Message-Id: <200311131620.hADGK0l24065@candle.pha.pa.us> Subject: Re: Taking database offline In-Reply-To: <20031113155021.46917.qmail@web21407.mail.yahoo.com> To: ow Date: Thu, 13 Nov 2003 11:20:00 -0500 (EST) Cc: "scott.marlowe" , pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/243 X-Sequence-Number: 11230 ow wrote: > > --- Bruce Momjian 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: The postmaster uses SIGTERM to tell a postgres process to quit normally and SIGQUIT to terminate without the normal cleanup. These signals should not be used by users. It is also unwise to send SIGKILL to a postgres process --- the postmaster will interpret this as a crash in postgres, and will force all the sibling postgres processes to quit as part of its standard crash-recovery procedure. -- 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