Is this a bug? - Mailing list pgsql-hackers

From Matthew T. O'Connor
Subject Is this a bug?
Date
Msg-id 41F68534.4070806@zeut.net
Whole thread Raw
Responses Re: Is this a bug?  (Michael Fuhr <mike@fuhr.org>)
Re: Is this a bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I think this may have been discussed before but I found this a bit 
surprising:

foo=# SELECT version();                                                
version                       
---------------------------------------------------------------------------------------------------------PostgreSQL
7.4.3on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.2 
 
20031022 (Red Hat Linux 3.3.2-1)
(1 row)

foo=# create table foo (id1 int, id2 int, id3 int);
CREATE TABLE
foo=# ALTER TABLE foo ADD unique (id1,id2);
NOTICE:  ALTER TABLE / ADD UNIQUE will create implicit index 
"foo_id1_key" for table "foo"
ALTER TABLE
foo=# ALTER TABLE foo ADD unique (id1,id3);
NOTICE:  ALTER TABLE / ADD UNIQUE will create implicit index 
"foo_id1_key" for table "foo"
ERROR:  relation "foo_id1_key" already exists
foo=#


Now, I know I can specify a constraint name inside the alter command, 
but I still expected this to work.

Thanks,

Matthew



pgsql-hackers by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: Goals for 8.1
Next
From: Tom Lane
Date:
Subject: Re: Is this a bug?