Received: from resy5.fzk.de (resy5.fzk.de [141.52.68.8]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8CF6m706077 for ; Wed, 12 Sep 2001 11:06:48 -0400 (EDT) (envelope-from ch@rodos.fzk.de) Received: by rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id RAA18927 for ; Wed, 12 Sep 2001 17:06:55 +0200 (METDST) From: Haller Christoph Message-Id: <200109121506.RAA17397@rodos> Subject: ERROR: Cannot insert a duplicate key into a unique index To: pgsql-sql@postgresql.org Date: Wed, 12 Sep 2001 17:06:36 METDST X-Mailer: Elm [revision: 212.4] X-Archive-Number: 200109/62 X-Sequence-Number: 4708 [SQL] 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