Thread: Blocking access to the database??

Blocking access to the database??

From
Carlos
Date:

Hi Forum,

Is there a way to block access to the database or terminate ongoing connections while I carry-out updates or backups?

Thanks in advance for your reply

Re: Blocking access to the database??

From
Network Administrator
Date:
Quoting Carlos <Carlos@pbsinet.com>:

> Hi Forum,
>
> Is there a way to block access to the database or terminate ongoing
> connections while I carry-out updates or backups?
>
> Thanks in advance for your reply
>

In the system catalog, the pg_database table has a flag (bool field) that
controls access to the database.  I would think you could set that to false (as
the database admin user) do you work and then set it back to true.

I'm sure there is a better way of doing this though.  So I'm curious what other
people have to suggest.

--
Keith C. Perry
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

Re: Blocking access to the database??

From
Bruno Wolff III
Date:
On Thu, May 29, 2003 at 12:29:16 -0400,
  Carlos <Carlos@pbsinet.com> wrote:
> Hi Forum,
>
> Is there a way to block access to the database or terminate ongoing
> connections while I carry-out updates or backups?
>
> Thanks in advance for your reply

You could update pg_hba.conf and restart the database server.

Are you sure you want to do that though? You can do consistant backups
while the database is being updated by other people. And people will
see a consistant view of the database if you do your updates properly.

Re: Blocking access to the database??

From
Bruno Wolff III
Date:
Please keep this on the list. Especially if you are asking followup
questions as other people may be better placed to help you.

On Thu, May 29, 2003 at 13:49:31 -0400,
  Carlos Oliva <carlos@pbsinet.com> wrote:
> If I had to reorganize the database, I would prefer to terminate the
> connections.  Any way to do that without having to restart the db
> server?  Could I kill the PID's for the users (Linux RedHat)
>
> In order to modify a user's permissions, must I restart the db server?

I am not sure what the answer is to your first two questions.

>
> Can one do an SQL-dump while users are modifying the data?

Yes.

>
> -----Original Message-----
> From: Bruno Wolff III [mailto:bruno@wolff.to]
> Sent: Thursday, May 29, 2003 1:28 PM
> To: Carlos
> Cc: 'pgsql-general@postgresql.org'
> Subject: Re: [GENERAL] Blocking access to the database??
>
>
> On Thu, May 29, 2003 at 12:29:16 -0400,
>   Carlos <Carlos@pbsinet.com> wrote:
> > Hi Forum,
> >
> > Is there a way to block access to the database or terminate ongoing
> > connections while I carry-out updates or backups?
> >
> > Thanks in advance for your reply
>
> You could update pg_hba.conf and restart the database server.
>
> Are you sure you want to do that though? You can do consistant backups
> while the database is being updated by other people. And people will see
> a consistant view of the database if you do your updates properly.
>