Re: lock a database from new connections, without modifying

From: "Ben K(dot)" <bkim(at)coe(dot)tamu(dot)edu>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: lock a database from new connections, without modifying
Date: 2006-05-20 15:54:29
Message-ID: Pine.GSO.4.64.0605201051060.3823@coe.tamu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ben K. 2006-05-20 16:02:59 Re: find out all users under specific user
Previous Message Magus 2006-05-19 20:33:32 Re: postgres[xxxx]: [4-1] FATAL: role "pgsql" does not exist