Re: SQLSTATE code for duplicate constraint - Mailing list pgsql-general

From Tom Lane
Subject Re: SQLSTATE code for duplicate constraint
Date
Msg-id 523.1199407937@sss.pgh.pa.us
Whole thread Raw
In response to SQLSTATE code for duplicate constraint  (Dan Langille <dan@langille.org>)
List pgsql-general
Dan Langille <dan@langille.org> writes:
> What error code would be raised for a duplicate index name?

regression=# \set VERBOSITY verbose
regression=# create table t1 (f1 int);
CREATE TABLE
regression=# create index t1i on t1(f1);
CREATE INDEX
regression=# create index t1i on t1(f1);
ERROR:  42P07: relation "t1i" already exists
LOCATION:  index_create, index.c:567

Evidently it's ERRCODE_DUPLICATE_TABLE.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: negative duration times in query logs
Next
From: Ow Mun Heng
Date:
Subject: Re: [OT] Slony (initial) Replication - Slow