Duplicate constraint names in 7.0.3 - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Duplicate constraint names in 7.0.3
Date
Msg-id ECEHIKNFIMMECLEBJFIGMEHFCAAA.chriskl@familyhealth.com.au
Whole thread Raw
Responses Re: Duplicate constraint names in 7.0.3  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List 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



pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Extrordinarily Poor Performance....
Next
From: "Christopher Kings-Lynne"
Date:
Subject: RE: Re: New Linux xfs/reiser file systems