Skip site navigation (1) Skip section navigation (2)

Re: "duplicate key value": version 8.4 vs 8.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mountain oaf <mountainoaf(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: "duplicate key value": version 8.4 vs 8.1
Date: 2010-10-20 22:25:51
Message-ID: 28237.1287613551@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
mountain oaf <mountainoaf(at)gmail(dot)com> writes:
> When I run it against an 8.4.4 version of Postgres, data inserted into
> a table which violate an unique index are reported back to the program
> via sqlca.sqlcode as -403 ('duplicate key value violates unique
> constraint "my_index"').

> However, when I run the same program against an 8.1.2 database, the
> error isn't trapped. I'm explicitly looking for a -403 code via
> sqlca.sqlcode so am assuming that the error code is different in this
> version of the database.

AFAICS the ecpg code around that hasn't changed since 8.1, so I think
your assumption is in error.  You might try looking into the server
log to see what it thinks is happening.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Bruce MomjianDate: 2010-10-20 23:13:54
Subject: Re: Incremental Backup
Previous:From: mountain oafDate: 2010-10-20 21:59:50
Subject: "duplicate key value": version 8.4 vs 8.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group