Re: Scope of constraint names

From: Rod Taylor <rbt(at)zort(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Scope of constraint names
Date: 2002-07-04 11:59:49
Message-ID: 1025783990.250.115.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > 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.

So I am understanding correctly.

I think it would be a rare event to have more than one person changing
the database structure at the same time. Anyway, the index example is a
bad example isn't it? It already takes an lock on pg_class which is
just as global.

Check constraints and foreign key constraints are two that I can see
affected in the manner described.

Anyway, my current implementation has constraint names unique to the
relation only -- not the namespace, although my locking may be excessive
in that area.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-07-04 12:20:19 Re: BETWEEN Node & DROP COLUMN
Previous Message Christopher Kings-Lynne 2002-07-04 09:27:18 Re: BETWEEN Node & DROP COLUMN