Re: Way to shutdown/freeze/stop an individual database without taking postmaster down?

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Way to shutdown/freeze/stop an individual database without taking postmaster down?
Date: 2008-04-10 21:50:19
Message-ID: 60k5j5xtus.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ws3reg(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2008-04-10 22:35:28 Re: pgcrypto and dblink
Previous Message Scott Marlowe 2008-04-10 21:17:32 Re: Can´t connect but listen address and pg_hba configured correctly