Re: 9.3 and extended constraint error information - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: 9.3 and extended constraint error information
Date
Msg-id alpine.BSO.2.03.1309101837150.15199@ejurka.com
Whole thread Raw
In response to 9.3 and extended constraint error information  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: 9.3 and extended constraint error information  (Thomas Kellerer <spam_eater@gmx.net>)
List 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


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Regression: Problems with Timestamp arguments
Next
From: Vitalii Tymchyshyn
Date:
Subject: Re: Regression: Problems with Timestamp arguments