Re: LOCK DATABASE

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: LOCK DATABASE
Дата
Msg-id BANLkTimioq=USgp7m8Drcji=Qo0fa97tcg@mail.gmail.com
обсуждение исходный текст
Ответ на LOCK DATABASE  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: LOCK DATABASE
Список pgsql-hackers
On Tue, May 17, 2011 at 10:21 PM, Alvaro Herrera
<alvherre@alvh.no-ip.org> wrote:
>
> So we would have a new command LOCK DATABASE [FOR SESSION] or something
> like that; the pooler software would call that and then kill other
> existing application connections (using pg_terminate_backend() perhaps),
> then drop the database.  This LOCK DATABASE thingy would just be a
> simple function on top of LockSharedObject.  Since establishing a new
> connection requires grabbing a lock on the database via
> LockSharedObject, things would Just Work (or at least so it seems to
> me).
>
> UNLOCK DATABASE would be needed to release a session-level lock acquired
> by LOCK DATABASE FOR SESSION for the cases where you want to lock a
> database to safely do schema upgrades and the like.
>

So we the lock will be released at end of the session or when the
UNLOCK DATABASE command is invoked, right?
A question: why will we beign so rude by killing other sessions
instead of avoid new connections and wait until the current sessions
disconnect?

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL


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

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: deprecating contrib for PGXN
Следующее
От: Max Bourinov
Дата:
Сообщение: Passing an array or record to a stored procedure in PostgreSQL