Received: from mail.retep.org.uk ([216.126.85.184]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f21LB2x93325 for ; Thu, 1 Mar 2001 16:11:02 -0500 (EST) (envelope-from peter@retep.org.uk) Received: from heather.retep.org.uk ([193.113.114.7]) (authenticated) by mail.retep.org.uk (8.11.1/8.11.1) with ESMTP id f21L8lR92802; Thu, 1 Mar 2001 16:08:48 -0500 (EST) (envelope-from peter@retep.org.uk) Message-Id: <5.0.2.1.0.20010301210608.0222ab40@mail.retep.org.uk> X-Sender: peter@mail.retep.org.uk X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Thu, 01 Mar 2001 21:07:01 +0000 To: Max Khon , David Wall From: Peter Mount Subject: Re: JDBC error codes to detect duplicates? Cc: pgsql-interfaces@postgresql.org In-Reply-To: References: <017801c0a27c$4b0902a0$5a2b7ad8@expertrade.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Archive-Number: 200103/10 X-Sequence-Number: 1171 At 00:41 02/03/01 +0600, Max Khon wrote: >hi, there! > >On Thu, 1 Mar 2001, David Wall wrote: > > > It seems that when an INSERT causes a duplicate key exception for > > unique/primary keys, the JDBC library is throwing the SQL exception but > > there is no code that lets my program detect a duplicate key error, or > which > > key caused the duplicate error. > > > > Is there a plan for the JDBC to return the codes for postgres back to the > > program? I running 7.1beta4 now. > >AFAIK clean implementation of such feature is not possible because backend >protocol does not have error codes (only error messages) Thats correct. It's also not practical to get the driver to translate because the format of the messages can change between releases as well. Peter >/fjoe