pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Using \errverbose through JDBC
Date: Wed, 1 Feb 2017 16:51:35 +0100
Message-ID: <o6t061$4at$2@blaine.gmane.org> (raw)
In-Reply-To: <CA+cVU8N3wJ0gXtqSkx3LhuTiMPs40YeDpH4iuiRunYZRx8Bo9w@mail.gmail.com>
References: <o6sn6c$280$1@blaine.gmane.org>
	<CA+cVU8N3wJ0gXtqSkx3LhuTiMPs40YeDpH4iuiRunYZRx8Bo9w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Jorge Solórzano schrieb am 01.02.2017 um 16:11:
> The use case for this is?
> 
> AFAICT this is a libpq functionality, and since the JDBC driver is not libpq based then it can't use that functionality.
> 
> And it doesn't looks to be that useful for JDBC users:

I think it would: 

postgres> \set VERBOSITY verbose
postgres> insert into foobar (data) values ('x');
ERROR:  23502: null value in column "id" violates not-null constraint
DETAIL:  Failing row contains (null, x).
SCHEMA NAME:  public
TABLE NAME:  foobar
COLUMN NAME:  id
LOCATION:  ExecConstraints, execMain.c:1732
postgres>

When you run such an insert via JDBC, you'd only have "null value in column "id" violates not-null constraint" in the SQL Exception's message. 
But for logging purposes (on the client) it would be interesting to get details about the table into which the insert was done. 

This would enable to show those details (e.g. the table that was affected) in tools like SQL Workbench

Vladimir pointed me into the right direction. Those details are already available through the Postgres JDBC driver. 





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



view thread (9+ messages)  latest in thread

Message-ID: <o6t061$4at$2@blaine.gmane.org>
Permalink:  ../o6t061$4at$2@blaine.gmane.org/
Also on:    postgresql.org/message-id/o6t061$4at$2@blaine.gmane.org

 · 

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: spam_eater@gmx.net
  Subject: Re: Using \errverbose through JDBC
  In-Reply-To: <o6t061$4at$2@blaine.gmane.org>
  References: <o6sn6c$280$1@blaine.gmane.org> <CA+cVU8N3wJ0gXtqSkx3LhuTiMPs40YeDpH4iuiRunYZRx8Bo9w@mail.gmail.com> <o6t061$4at$2@blaine.gmane.org>

* 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