Re: SQLSTATE code for duplicate constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dan Langille <dan(at)langille(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQLSTATE code for duplicate constraint
Date: 2008-01-04 00:52:17
Message-ID: 523.1199407937@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dan Langille <dan(at)langille(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2008-01-04 02:44:14 Re: [OT] Slony (initial) Replication - Slow
Previous Message Tom Lane 2008-01-04 00:35:25 Re: negative duration times in query logs