Re: Taking database offline

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: ow <oneway_111(at)yahoo(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Taking database offline
Date: 2003-11-13 05:10:11
Message-ID: 200311130510.hAD5AB625794@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message ow 2003-11-13 07:05:03 Re: Taking database offline
Previous Message A.Bhuvaneswaran 2003-11-13 04:46:15 Re: easy way to copy all DBs and users on a server