Re: Way to shutdown/freeze/stop an individual database without taking postmaster down? - Mailing list pgsql-general

From Chris Browne
Subject Re: Way to shutdown/freeze/stop an individual database without taking postmaster down?
Date
Msg-id 60k5j5xtus.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to Way to shutdown/freeze/stop an individual database without taking postmaster down?  ("W S" <ws3reg@gmail.com>)
List pgsql-general
ws3reg@gmail.com ("W S") writes:
> I was asked this question, and I wasn't sure if it is possible:
>
>
> do you know of a way to stop just one database (not delete/drop) on
> our PostgreSQL 8.1 server?
>
>
> And, while I know how to shut down postmaster, and/or put in rules to
> pg_hba.conf to limit access to a certain database, is there any way to
> freeze or stop just one database and not others?  I'm attempting to
> RTFM it, but so far I've had no luck.

You could put in rules to pg_hba.conf to shut users out of a
particular database, and then run "pg_ctl reload" to signal the
postmaster to start applying the new rules.

That will prevent any new connections from coming into the database in
question.

But does not get rid of existing connections.  You could kill the
backends associated with the existing connections...  You can query
pg_catalog.pg_stat_activity to find the relevant list.
--
let name="cbbrowne" and tld="linuxdatabases.info" in String.concat "@" [name;tld];;
http://cbbrowne.com/info/advocacy.html
Whatever is  contradictory or paradoxical is called  the  back of God.
His face, where all exists in perfect harmony, cannot be seen by man.

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Can´t connect but listen address and pg_hba configured correctly
Next
From: Chris Browne
Date:
Subject: Re: pgcrypto and dblink