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

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Way to shutdown/freeze/stop an individual database without taking postmaster down?
Дата
Msg-id 47FE6C79.1040603@postnewspapers.com.au
обсуждение исходный текст
Ответ на Way to shutdown/freeze/stop an individual database without taking postmaster down?  ("W S" <ws3reg@gmail.com>)
Ответы Re: Way to shutdown/freeze/stop an individual database without taking postmaster down?
Список pgsql-general
W S wrote:
> Greetings,
>
> 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?

One possible way:

You can update its pg_database record, setting datallowconn to 'f' to
disable new connections to the DB, then boot off all existing users of
it by killing their backends. A discussion about this appeared here
recently, and a search of the archives for `datallowconn' should find it.

> 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.

I haven't checked whether pg_hba.conf rules are reloaded, but `pg_ctl
reload' can re-read some settings without a postmaster restart. So you
might be able to disallow access in pg_hba then reload.

I'd be curious to know if that works and if/how it affects existing
connections - though I can always test it myself.

--
Craig Ringer

В списке pgsql-general по дате отправления:

Предыдущее
От: Ben
Дата:
Сообщение: Re: Way to shutdown/freeze/stop an individual database without taking postmaster down?
Следующее
От: Sam Mason
Дата:
Сообщение: Re: percentile rank query