Re: Duplicate constraint names in 7.0.3

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Duplicate constraint names in 7.0.3
Date: 2001-05-04 03:42:57
Message-ID: Pine.BSF.4.21.0105032039520.57206-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 3 May 2001, Tom Lane wrote:

> Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)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.

The only thing I'd say is it might be confusing to people that some
constraint names must be unique (unique, primary key) and that others
can be duplicated (check, foreign key), not that all that many people
probably name their unique constraints.

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

Definately true if non-unique names are allowed.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-05-04 04:33:22 RE: Duplicate constraint names in 7.0.3
Previous Message Lamar Owen 2001-05-04 03:28:42 Re: Packaging 7.1.1