Duplicate constraint names in 7.0.3

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Duplicate constraint names in 7.0.3
Date: 2001-05-04 01:48:23
Message-ID: ECEHIKNFIMMECLEBJFIGMEHFCAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have noticed that it is possible to create duplicate CHECK (haven't tried
other) constraints in 7.0.3 by doing something like this:

CREATE TABLE "test" (
"a" int4,
CHECK (a < 400),
CONSTRAINT "$1" CHECK (a > 5)
);

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.

Surely there should be a UNIQUE (rcrelid, rcname) on pg_relcheck?, or at
least better checking in the CREATE TABLE code?

Chris

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-05-04 01:49:39 RE: Re: New Linux xfs/reiser file systems
Previous Message Bruce Momjian 2001-05-04 01:45:20 Re: Extrordinarily Poor Performance....