Re: Scope of constraint names - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Scope of constraint names
Date
Msg-id 29757.1025756957@sss.pgh.pa.us
Whole thread Raw
In response to Re: Scope of constraint names  (Rod Taylor <rbt@zort.ca>)
Responses Re: Scope of constraint names  (Rod Taylor <rbt@zort.ca>)
List pgsql-hackers
Rod Taylor <rbt@zort.ca> writes:
>> I don't want to have to take a global lock whenever we
>> create an index.

> I don't understand why a global lock is necessary --

To be sure we are creating a unique constraint name.

> and not simply a lock on the pg_constraint table

In this context, a lock on pg_constraint *is* global, because it will
mean that no one else can be creating an index on some other table.
They'd need to hold that same lock to ensure that *their* chosen
constraint name is unique.
        regards, tom lane




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: listen/notify argument (old topic revisited)
Next
From: Tom Lane
Date:
Subject: Re: regress/results directory problem