Re: 9.3 and extended constraint error information

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: 9.3 and extended constraint error information
Date: 2013-09-10 22:40:52
Message-ID: alpine.BSO.2.03.1309101837150.15199@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 11 Sep 2013, Thomas Kellerer wrote:

> I was wondering if the new extended constraint error information[1] will be
> exposed through JDBC in the next version of the driver?
>

Yes,

https://github.com/pgjdbc/pgjdbc/commit/e9ac5f8d964202ab5d43e401d74dcd76cefd112e

It's a little messy to get access to these fields with something like:

} catch (SQLException sqle) {
if (sqle instanceof PSQLException) {
PSQLException psqle = (PSQLException)sqle;
ServerErrorMessage s = psqle.getServerErrorMessage();
// Not all PSQLExceptions come from the server...
if (s != null) {
System.err.println(s.getColumn());
}
}
}

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vitalii Tymchyshyn 2013-09-11 06:03:09 Re: Regression: Problems with Timestamp arguments
Previous Message Kris Jurka 2013-09-10 22:37:04 Re: Regression: Problems with Timestamp arguments