Redundant UNIQUE specs (was Re: [GENERAL] bad error message) - Mailing list pgsql-hackers

From Tom Lane
Subject Redundant UNIQUE specs (was Re: [GENERAL] bad error message)
Date
Msg-id 24919.982023560@sss.pgh.pa.us
Whole thread Raw
In response to bad error message  ("Martin A. Marques" <martin@math.unl.edu.ar>)
List pgsql-hackers
"Martin A. Marques" <martin@math.unl.edu.ar> writes:
> test=# CREATE TABLE dedicacion (
> test(#        id_dedi          SERIAL UNIQUE,
> test(#        nombre_dedi      CHAR(10) UNIQUE
> test(# );
> NOTICE:  CREATE TABLE will create implicit sequence 'dedicacion_id_dedi_seq' 
> for SERIAL column 'dedicacion.id_dedi'
> NOTICE:  CREATE TABLE/UNIQUE will create implicit index 
> 'dedicacion_id_dedi_key' for table 'dedicacion'
> NOTICE:  CREATE TABLE/UNIQUE will create implicit index 
> 'dedicacion_id_dedi_key' for table 'dedicacion'
> NOTICE:  CREATE TABLE/UNIQUE will create implicit index 
> 'dedicacion_nombre_dedi_key' for table 'dedicacion'
> ERROR:  Cannot create index: 'dedicacion_id_dedi_key' already exists

Hm.  There is code in the parser to discard duplicate UNIQUE
specifications when a PRIMARY KEY is present.  Shouldn't it just
do so in all cases, PRIMARY KEY or no?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: pg_dump output
Next
From: Philip Warner
Date:
Subject: Re: pg_dump output