Re: Extracting more useful information from PSQLException - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Extracting more useful information from PSQLException
Date
Msg-id alpine.BSO.2.00.1212282053460.18287@leary.csoft.net
Whole thread Raw
In response to Extracting more useful information from PSQLException  (Steven Schlansker <stevenschlansker@gmail.com>)
Responses Re: Extracting more useful information from PSQLException  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc

On Fri, 28 Dec 2012, Steven Schlansker wrote:

> While designing web services that are backed by PostgreSQL, it is often
> helpful to report a more useful HTTP error than a generic "Something
> went wrong, sorry dude".
>
> Is it possible / would it be a good addition to expose structured SQL
> error information through JDBC?  If such a thing does not exist, is this
> a feasible contribution?  I expect it might require some hacking on the
> PostgreSQL server side to expose the error information in a structured
> manner.  Or am I just dreaming too much, and this is not feasible?
>

There is currently a patch in progress and under discussion for the server
changes to expose this information.  I would recommend reviewing this and
joining the discussion on -hackers if you have something useful to
contribute.  I don't know anything about the patch other than that it
exists.  I would be useful to see how much the JDBC driver would have to
change to take advantage of it.

https://commitfest.postgresql.org/action/patch_view?id=843

Kris Jurka



pgsql-jdbc by date:

Previous
From: Steven Schlansker
Date:
Subject: Extracting more useful information from PSQLException
Next
From: Steven Schlansker
Date:
Subject: Set read-only connection from a connect string parameter