pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
9.3 and extended constraint error information
3+ messages / 2 participants
[nested] [flat]

* 9.3 and extended constraint error information
@ 2013-09-10 22:04 Thomas Kellerer <spam_eater@gmx.net>
  2013-09-10 22:40 ` Re: 9.3 and extended constraint error information Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Thomas Kellerer @ 2013-09-10 22:04 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

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

Regards
Thomas

[1] http://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQRESULTERRORFIELD



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: 9.3 and extended constraint error information
  2013-09-10 22:04 9.3 and extended constraint error information Thomas Kellerer <spam_eater@gmx.net>
@ 2013-09-10 22:40 ` Kris Jurka <books@ejurka.com>
  2013-09-11 06:22   ` Re: 9.3 and extended constraint error information Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Kris Jurka @ 2013-09-10 22:40 UTC (permalink / raw)
  To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: 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


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: 9.3 and extended constraint error information
  2013-09-10 22:04 9.3 and extended constraint error information Thomas Kellerer <spam_eater@gmx.net>
  2013-09-10 22:40 ` Re: 9.3 and extended constraint error information Kris Jurka <books@ejurka.com>
@ 2013-09-11 06:22   ` Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Kellerer @ 2013-09-11 06:22 UTC (permalink / raw)
  To: pgsql-jdbc

Kris Jurka, 11.09.2013 00:40:
> 
> 
> 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());
>     }
>   }
> }

Ah, great. That's good enough for me.

Thanks for the feedback
Thomas





-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2013-09-11 06:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 22:04 9.3 and extended constraint error information Thomas Kellerer <spam_eater@gmx.net>
2013-09-10 22:40 ` Kris Jurka <books@ejurka.com>
2013-09-11 06:22   ` Thomas Kellerer <spam_eater@gmx.net>

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