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 2C2BED1B543 for ; Thu, 13 Nov 2003 05:10:50 +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 52467-07 for ; Thu, 13 Nov 2003 01:10:19 -0400 (AST) Received: from candle.pha.pa.us (unknown [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 71E58D1B502 for ; Thu, 13 Nov 2003 01:10:13 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id hAD5AB625794; Thu, 13 Nov 2003 00:10:11 -0500 (EST) From: Bruce Momjian Message-Id: <200311130510.hAD5AB625794@candle.pha.pa.us> Subject: Re: Taking database offline In-Reply-To: To: "scott.marlowe" Date: Thu, 13 Nov 2003 00:10:11 -0500 (EST) Cc: ow , 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/229 X-Sequence-Number: 11216 scott.marlowe wrote: > On Wed, 12 Nov 2003, ow wrote: > > > Hi, > > > > Is there a way to take the database offline to keep users out? > > Is there a way to take the database offline but still allowing pg_restore to > > run against it? > > Yes, as of 7.3 you can create entries in pg_hba.conf that control who can > connect to what database. Just make a backup of the original pg_hba.conf, > and set up your copy to have only the postgres (or other) superuser be > allowed to connect. Then, swap the two hba files and restart the server. Rather than restart the server (kicking everyone out), does 'reload' help to keep new users out and let the old ones leave on their own? -- 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