Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYyP2-0000Wf-Kq for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Feb 2017 17:09:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cYyP2-0006kI-7k for pgsql-jdbc@arkaria.postgresql.org; Wed, 01 Feb 2017 17:09:04 +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 1cYwlX-00067j-Sg for pgsql-jdbc@postgresql.org; Wed, 01 Feb 2017 15:24:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cYwlV-0005wO-37 for pgsql-jdbc@postgresql.org; Wed, 01 Feb 2017 15:24:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v11FO1Bi007869; Wed, 1 Feb 2017 10:24:01 -0500 From: Tom Lane To: =?UTF-8?Q?Jorge_Sol=C3=B3rzano?= cc: Thomas Kellerer , List Subject: Re: Using \errverbose through JDBC In-reply-to: References: Comments: In-reply-to =?UTF-8?Q?Jorge_Sol=C3=B3rzano?= message dated "Wed, 01 Feb 2017 09:11:16 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7867.1485962641.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 01 Feb 2017 10:24:01 -0500 Message-ID: <7868.1485962641@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 =3D?UTF-8?Q?Jorge_Sol=3DC3=3DB3rzano?=3D writes: > 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: It's not really useful for programs, I think. ISTM a program would prefer to have access to the individual fields of the error message. There definitely are fields in there that are of interest, for some messages: regression=3D# create table t1 (f1 int primary key); CREATE TABLE regression=3D# create table t2 (f2 int references t1); CREATE TABLE regression=3D# insert into t2 values(11); ERROR: insert or update on table "t2" violates foreign key constraint "t2_= f2_fkey" DETAIL: Key (f2)=3D(11) is not present in table "t1". regression=3D# \errverbose=20 ERROR: 23503: insert or update on table "t2" violates foreign key constrai= nt "t2_f2_fkey" DETAIL: Key (f2)=3D(11) is not present in table "t1". SCHEMA NAME: public TABLE NAME: t2 CONSTRAINT NAME: t2_f2_fkey LOCATION: ri_ReportViolation, ri_triggers.c:3324 So really what would be appropriate for JDBC to provide, IMO, is some equivalent of libpq's PQresultErrorField(). Perhaps that's already there. regards, tom lane --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc