Re: Duplicate constraint names in 7.0.3 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Duplicate constraint names in 7.0.3
Date
Msg-id 22759.988946669@sss.pgh.pa.us
Whole thread Raw
In response to Re: Duplicate constraint names in 7.0.3  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Duplicate constraint names in 7.0.3
RE: Duplicate constraint names in 7.0.3
List pgsql-hackers
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> If I read the spec correctly, table constraint names are supposed to be
> unique across a schema.

That's what the spec says, but I doubt we should enforce it.  For one
thing, what do you do with inherited constraints?  Invent a random name
for them?  No thanks.  The absolute limit of what I'd accept is
constraint name unique for a given table ... and even that seems like
an unnecessary restriction.

>> I was just fiddling around with trying to implement the 'DROP CONSTRAINT'
>> code (it's quite hard - don't wait up for me!) and it would seem to be a bad
>> thing that it's possible to have two constraints with the same name in a
>> table.

A reasonable interpretation of DROP CONSTRAINT "foo" is to drop *all*
constraints named "foo" on the target table.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: RE: Duplicate constraint names in 7.0.3
Next
From: Lamar Owen
Date:
Subject: Re: Packaging 7.1.1