CHECK constraint names - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject CHECK constraint names
Date
Msg-id NEBBIOAJBMEENKACLNPCIELHCCAA.chriskl@familyhealth.com.au
Whole thread Raw
Responses Re: CHECK constraint names
List pgsql-hackers
Hi,

Is it correct behaviour that unnamed table-level check constraints get the
names '$1', '$2', '$3', etc. in Postgres 7.0.3???

Eg, using table constraints:
----------------------------

test=# create table test (temp char(1) NOT NULL, CHECK (temp IN ('M',
'F')));
CREATE
test=# select rcname from pg_relcheck;
rcname
$1
(1 row)

And, even worse - I think this has got to be a bug:
---------------------------------------------------

test=# create table test (temp char(1) NOT NULL, CHECK (temp IN ('M',
'F')));
CREATE
test=# create table test2 (temp char(1) NOT NULL, CHECK (temp IN ('M',
'F')));
CREATE
test=# select rcname from pg_relcheck;rcname
--------$1$1
(2 rows)

Two constraints with the same name!!!!

And if you use column constraints:
----------------------------------

test=# create table test (temp char(1) NOT NULL CHECK (temp IN ('M', 'F')));
CREATE
test=# select rcname from pg_relcheck; rcname
-----------test_temp
(1 row)

--
Christopher Kings-Lynne
Family Health Network (ACN 089 639 243)



pgsql-hackers by date:

Previous
From: Ryan Kirkpatrick
Date:
Subject: PostgreSQL pre-7.1 Linux/Alpha Status...
Next
From: bpalmer
Date:
Subject: 7.1 snapshot on i386 BSD MAJOR failure