Re: "duplicate key value": version 8.4 vs 8.1 - Mailing list pgsql-novice

From Tom Lane
Subject Re: "duplicate key value": version 8.4 vs 8.1
Date
Msg-id 28237.1287613551@sss.pgh.pa.us
Whole thread Raw
In response to "duplicate key value": version 8.4 vs 8.1  (mountain oaf <mountainoaf@gmail.com>)
Responses Re: "duplicate key value": version 8.4 vs 8.1  (mountain oaf <mountainoaf@gmail.com>)
List pgsql-novice
mountain oaf <mountainoaf@gmail.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

pgsql-novice by date:

Previous
From: mountain oaf
Date:
Subject: "duplicate key value": version 8.4 vs 8.1
Next
From: Bruce Momjian
Date:
Subject: Re: Incremental Backup