Re: documentation about explicit locking

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: documentation about explicit locking
Date: 2018-07-18 09:30:59
Message-ID: 9e448f13-5641-0ff6-2d4c-b850ab77c499@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06.07.18 04:00, Amit Langote wrote:
> On 2018/07/05 23:02, Robert Haas wrote:
>> On Wed, Jul 4, 2018 at 3:09 AM, Amit Langote
>> <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>> I wonder why we mention on the following page that CREATE COLLATION
>>> requires SHARE ROW EXCLUSIVE lock
>>>
>>> https://www.postgresql.org/docs/devel/static/explicit-locking.html
>>>
>>> I know that's the lock taken on the pg_collation catalog, but do we need
>>> to mention locks taken by a DDL command on the catalogs it affects? All
>>> other commands mentioned on the page require to specify the table name
>>> that the lock will be taken on.
>>
>> Yes, that looks odd.
>
> OK, here is a patch.
>
> I see that it was one of Peter E's commits that added that, so cc'd him.

The reason this is mentioned is that CREATE COLLATION takes a SHARE ROW
EXCLUSIVE lock on pg_collation whereas similar CREATE commands only take
a ROW EXCLUSIVE lock on their catalogs. (So you can only have one
CREATE COLLATION running at a time. The reasons for this are explained
in pg_collation.c.) I think mentioning this was requested during patch
review.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kato, Sho 2018-07-18 09:44:29 RE: Speeding up INSERTs and UPDATEs to partitioned tables
Previous Message Peter Eisentraut 2018-07-18 09:20:57 Re: Alter index rename concurrently to