Re: LOCK DATABASE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: LOCK DATABASE
Date
Msg-id 23651.1305827429@sss.pgh.pa.us
Whole thread Raw
In response to Re: LOCK DATABASE  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Tom Lane's message of jue may 19 13:34:13 -0400 2011:
>> I can't see getting rid of that lock, since we'd simply have to invent
>> some other interlock for new connections vs. DROP DATABASE.  However,
>> I do think that we might sometime need to convert it to a session lock
>> that's held for the life of the backend.  If this feature can't cope
>> with that, that'd be a potential problem.

> The following things acquire a lock on database:

>  ALTER DATABASE SET
>  ALTER DATABASE OWNER
>  COMMENT ON DATABASE

> So as far as features that would cause a problem if we ever decide to
> take a lock on database for the duration of the whole session, this
> isn't the first one.  We'd have to invent a fix for those other things
> anyway.

Only if all the locks involved are exclusive ... which is not what
I was suggesting, and not what they are now IIRC.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Patch by request at pgcon
Next
From: Stephen Frost
Date:
Subject: Re: Patch by request at pgcon