Re: JDBC error codes to detect duplicates?

From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Max Khon <fjoe(at)iclub(dot)nsu(dot)ru>, David Wall <d(dot)wall(at)computer(dot)org>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: JDBC error codes to detect duplicates?
Date: 2001-03-01 21:07:01
Message-ID: 5.0.2.1.0.20010301210608.0222ab40@mail.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 2001-03-01 21:28:36 Re: JDBC error codes to detect duplicates?
Previous Message Chris Haas 2001-03-01 20:32:07 connection problems odbc-PostgreSQL