Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYyLR-0000QQ-UC for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Feb 2017 17:05:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cYyLR-0003O8-H2 for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Feb 2017 17:05:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cYxFc-0007Ax-9J for pgsql-jdbc@postgresql.org; Wed, 01 Feb 2017 15:55:16 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cYxFa-0006XI-CG for pgsql-jdbc@postgresql.org; Wed, 01 Feb 2017 15:55:15 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cYxFQ-00043z-VY for pgsql-jdbc@postgresql.org; Wed, 01 Feb 2017 16:55:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: Using \errverbose through JDBC Date: Wed, 1 Feb 2017 16:51:35 +0100 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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