Re: Locking for Rename To new_name works differently for different objects - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Locking for Rename To new_name works differently for different objects
Date
Msg-id CA+TgmoZZe=nND7X0k9GiSJwsBvhUQBFBoVu=-yHq94t7qkPq4Q@mail.gmail.com
Whole thread Raw
In response to Re: Locking for Rename To new_name works differently for different objects  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Locking for Rename To new_name works differently for different objects
List pgsql-hackers
On Wed, Oct 15, 2014 at 10:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amit Kapila <amit.kapila16@gmail.com> writes:
>> I have observed that for renaming some of the objects
>> AccessExclusiveLock is taken on object whereas for
>> other kind of objects no lock is taken on object before
>> renaming the object.
>
> The usual theory for DDL updates of all types (not just rename)
> is that an explicit lock is only needed for objects whose catalog
> representation comprises more than one row.  Otherwise, the implicit
> locking involved in updating that row is sufficient to serialize
> different updates.

That's an interesting point that I hadn't considered, but I'm willing
to believe that at least some of the differences might also be
haphazard.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: group locking: incomplete patch, just for discussion
Next
From: Fujii Masao
Date:
Subject: Re: Maximum number of WAL files in the pg_xlog directory