X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 575B953397 for ; Wed, 6 Apr 2005 00:14:35 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17145-06 for ; Tue, 5 Apr 2005 23:14:26 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 93B9C538A5 for ; Wed, 6 Apr 2005 00:14:26 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DIxFb-00042w-U9; Wed, 06 Apr 2005 11:14:28 +1200 Message-ID: <42531BD3.80801@opencloud.com> Date: Wed, 06 Apr 2005 11:14:27 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: NielsG , pgsql-jdbc@postgresql.org Subject: Re: Minor Feature Request References: <42530F4C.6060502@aquafold.com> <425317D7.4020509@opencloud.com> In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/34 X-Sequence-Number: 12641 Kris Jurka wrote: > > On Wed, 6 Apr 2005, Oliver Jowett wrote: > > >>Perhaps we should put accessors for the various message parts on >>PSQLException, but leave the SQLException message as it currently is. >> > > > This could work for a pg specific admin tool or client, but not a > generic/portable java client. Right, but aren't we talking about a client that knows about postgresql internals anyway? There's no concept of line numbers, hints, etc. associated with an exception in standard JDBC anyway, and as you said it's not obvious what is useful to have in the error message for standard clients. Niels was talking about putting the line number into the message, then parsing the message to get this info. That seems pretty horrible since then you have lots of extra work in the app, and the app is still postgresql-specific.. It seems much cleaner if it can just do something like: try { // ... } catch (PSQLException e) { if (e instanceof PSQLException) linenumber = ((PSQLException)e).getLineNumber(); else linenumber = -1; // handle exception } -O