pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ivan Bojer <ibojer@gmail.com>
To: Dennis Brakhane <brakhane@googlemail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Please help! - Constraints Exception
Date: Wed, 17 Jun 2009 13:37:49 -0700
Message-ID: <ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com> (raw)
In-Reply-To: <226a19190906171304n2b306a0ufc676ad7be76b0e1@mail.gmail.com>
References: <ac6251120906171257q69116eees210591ca33eae151@mail.gmail.com>
	<226a19190906171304n2b306a0ufc676ad7be76b0e1@mail.gmail.com>

FYI I figured what was the problem. The database log level was changed
to FATAL from ERROR (default?).



On Wed, Jun 17, 2009 at 1:04 PM, Dennis Brakhane<brakhane@googlemail.com> wrote:
> On Wed, Jun 17, 2009 at 9:57 PM, Ivan Bojer<ibojer@gmail.com> wrote:
>> I have a table with UNIQUE constraint on the column. Inserting 2 of
>> same values on it fails (as it should)
>> and I can see DBLog Error message. Alas, there is no exception thrown
>> from JDBC so that I can properly
>> handle it.
>
> This is from memory, so if I talk nonsense, I hope somebody corrects me.
>
> The exception thrown should be a SQLException. These have a
> "getSQLState" method which returns a string. If this string is
> "23505", you have a UNIQUE violation.
>
> You can see the possible error codes here:
>
> http://www.postgresql.org/docs/8.3/static/errcodes-appendix.html
>



view thread (4+ messages)

Message-ID: <ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com>
Permalink:  ../ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com/
Also on:    postgresql.org/message-id/ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: ibojer@gmail.com, brakhane@googlemail.com
  Subject: Re: Please help! - Constraints Exception
  In-Reply-To: <ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com>
  References: <ac6251120906171257q69116eees210591ca33eae151@mail.gmail.com> <226a19190906171304n2b306a0ufc676ad7be76b0e1@mail.gmail.com> <ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox