In our PHP app, we are also forced to parse error messages to get that kind
of information.  Register my vote for error codes (Tom Lane style...)

Chris

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Haller Christoph
> Sent: Thursday, 13 September 2001 7:18 PM
> To: pgsql-hackers@postgresql.org
> Subject: [HACKERS] ERROR: Cannot insert a duplicate key into a unique
> index
>
>
> [HACKERS] ERROR:  Cannot insert a duplicate key into a unique index
>
> I'm working on a C code application using loads of
> insert commands.
> It is essential to distinguish between an error
> coming from a misformed command or other fatal
> reasons and a duplicate key.
> In either case, the PQresultStatus() returns
> PGRES_FATAL_ERROR
> I can check PQresultErrorMessage() for the
> error message above, but then I have to rely
> on this string never be changed.
> This is no good programming style.
> Does anybody have another, better idea or is
> there at least a header file available, where
> all the error messages can be found?
>
> Regards, Christoph
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


Thu, 13 Sep 2001 18:31:06 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: ERROR:  Cannot insert a duplicate key into a unique index
[HACKERS] ERROR:  Cannot insert a duplicate key into a unique index

I'm working on a C code application using loads of 
insert commands. 
It is essential to distinguish between an error 
coming from a misformed command or other fatal 
reasons and a duplicate key. 
In either case, the PQresultStatus() returns 
PGRES_FATAL_ERROR
I can check PQresultErrorMessage() for the 
error message above, but then I have to rely 
on this string never be changed. 
This is no good programming style. 
Does anybody have another, better idea or is 
there at least a header file available, where 
all the error messages can be found? 

Regards, Christoph

Thu, 13 Sep 2001 11:17:46 METDST
Haller Christoph <ch@rodos.fzk.de>
ERROR:  Cannot insert a duplicate key into a unique index
Error codes would be excellent!

-r


>In our PHP app, we are also forced to parse error messages to get that kind
>of information.  Register my vote for error codes (Tom Lane style...)
>
>Chris


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.251 / Virus Database: 124 - Release Date: 4/26/01
Thu, 13 Sep 2001 11:26:46 -0400
Ryan Mahoney <ryan@paymentalliance.net>
Re: ERROR:  Cannot insert a duplicate key into a