Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJdnj-0004dF-Eu for pgsql-jdbc@arkaria.postgresql.org; Wed, 11 Sep 2013 06:21:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VJdni-0007Vw-VV for pgsql-jdbc@arkaria.postgresql.org; Wed, 11 Sep 2013 06:21:19 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJdni-0007Vq-9m for pgsql-jdbc@postgresql.org; Wed, 11 Sep 2013 06:21:18 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJdnX-0004s1-Bz for pgsql-jdbc@postgresql.org; Wed, 11 Sep 2013 06:21:17 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VJdnU-0006at-Bm for pgsql-jdbc@postgresql.org; Wed, 11 Sep 2013 08:21:04 +0200 Received: from 217.110.94.121 ([217.110.94.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Sep 2013 08:21:04 +0200 Received: from spam_eater by 217.110.94.121 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Sep 2013 08:21:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: 9.3 and extended constraint error information Date: Wed, 11 Sep 2013 08:22:37 +0200 Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 217.110.94.121 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-Pg-Spam-Score: 0.6 (/) 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 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