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

"duplicate key value": version 8.4 vs 8.1

From: mountain oaf <mountainoaf(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: "duplicate key value": version 8.4 vs 8.1
Date: 2010-10-20 21:59:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I am a Postgres newbie using a C program to add records to a Postgres database.

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.

I've had a look on Teh Interwebs around to try and find out what the
equivalent code is for 8.1.2 but have had no success so far. Could
anyone point me in the right direction, please?

Thanks in advance for any assistance,



pgsql-novice by date

Next:From: Tom LaneDate: 2010-10-20 22:25:51
Subject: Re: "duplicate key value": version 8.4 vs 8.1
Previous:From: Donald KerrDate: 2010-10-20 17:08:30
Subject: Re: Hex to Dec Conversion

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