pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Kris Jurka <books@ejurka.com>
Cc: NielsG <NielsG@aquafold.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Minor Feature Request
Date: Wed, 06 Apr 2005 11:14:27 +1200
Message-ID: <42531BD3.80801@opencloud.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0504051759410.22871@leary.csoft.net>
References: <42530F4C.6060502@aquafold.com>
	<Pine.BSO.4.56.0504051735580.2530@leary.csoft.net>
	<425317D7.4020509@opencloud.com>
	<Pine.BSO.4.56.0504051759410.22871@leary.csoft.net>

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



view thread (8+ messages)  latest in thread

Message-ID: <42531BD3.80801@opencloud.com>
Permalink:  ../42531BD3.80801@opencloud.com/
Also on:    postgresql.org/message-id/42531BD3.80801@opencloud.com

 · 

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: oliver@opencloud.com, books@ejurka.com, NielsG@aquafold.com
  Subject: Re: Minor Feature Request
  In-Reply-To: <42531BD3.80801@opencloud.com>
  References: <42530F4C.6060502@aquafold.com> <Pine.BSO.4.56.0504051735580.2530@leary.csoft.net> <425317D7.4020509@opencloud.com> <Pine.BSO.4.56.0504051759410.22871@leary.csoft.net> <42531BD3.80801@opencloud.com>

* 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