Re: lock a database from new connections, without modifying - Mailing list pgsql-admin

From Ben K.
Subject Re: lock a database from new connections, without modifying
Date
Msg-id Pine.GSO.4.64.0605201051060.3823@coe.tamu.edu
Whole thread Raw
In response to lock a database from new connections, without modifying pg_hba.conf  ("Marc G. Fournier" <scrappy@postgresql.org>)
List pgsql-admin
> Is that possible?  I've checked the docs for 8.1, and am not finding anything,
> nor anything in contrib ...
> the best I've been able to think of so far is to modify pg_hba.conf to not
> allow new connections for the duration of the operations I need to perform
> (drop and create a database) ...

Just in case ...

update pg_catalog.pg_database set datallowconn = false where datname =
'...';

http://archives.postgresql.org/pgsql-docs/2004-11/msg00015.php
http://www.postgresql.org/docs/8.1/interactive/manage-ag-templatedbs.html


My twopence.

Ben K.
Developer
http://benix.tamu.edu

pgsql-admin by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: query optimization - mysql vs postgresql
Next
From: "Ben K."
Date:
Subject: Re: find out all users under specific user