Skip site navigation (1) Skip section navigation (2)

Re: Please help! - Constraints Exception

From: Ivan Bojer <ibojer(at)gmail(dot)com>
To: Dennis Brakhane <brakhane(at)googlemail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Please help! - Constraints Exception
Date: 2009-06-17 20:37:49
Message-ID: ac6251120906171337i12f3065dibe8e5435dcf081de@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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(at)googlemail(dot)com> wrote:
> On Wed, Jun 17, 2009 at 9:57 PM, Ivan Bojer<ibojer(at)gmail(dot)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
>

In response to

pgsql-jdbc by date

Next:From: Thomas FinneidDate: 2009-06-19 10:37:15
Subject: Connection exceptions
Previous:From: Dennis BrakhaneDate: 2009-06-17 20:05:36
Subject: Re: Please help! - Constraints Exception

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group