ERROR: Cannot insert a duplicate key into a unique index

From: Haller Christoph <ch(at)rodos(dot)fzk(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: ERROR: Cannot insert a duplicate key into a unique index
Date: 2001-09-13 11:17:46
Message-ID: 200109130917.LAA18151@rodos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thurstan R. McDougle 2001-09-13 12:03:54 Re: count of occurences PLUS optimisation
Previous Message Christopher Kings-Lynne 2001-09-13 10:31:06 Re: ERROR: Cannot insert a duplicate key into a unique index