From: dmp <danap@ttc-cmc.net>
To: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Patch: Some more state codes
Date: Fri, 09 Sep 2011 08:50:42 -0600
Message-ID: <4E6A27C2.6060508@ttc-cmc.net> (raw)
In-Reply-To: <alpine.BSO.2.00.1109091019350.4040@leary.csoft.net>
References: <x6sjo8bbe4.fsf@2ndquadrant.com>
<alpine.BSO.2.00.1109071229020.27523@leary.csoft.net>
<x6bouwavk9.fsf@2ndquadrant.com>
<alpine.BSO.2.00.1109091019350.4040@leary.csoft.net>
Kris Jurka wrote:
>
>
> On Wed, 7 Sep 2011, Johann 'Myrkraverk' Oskarsson wrote:
>
>> Well, for application use imagine this scenario (from an actual
>> application of mine):
>>
>> try {
>> CREATE TABLE t ...
>> } catch ( SQLException e ) {
>> if ( e.getSQLState().equals( PSQLState.DUPLICATE_TABLE ) )
>> ; // do something or ignore when the table exists already
>> ...
>> }
>>
>>
>> Now, if you don't want applications to use PSQLState and rely on the
>> numerical values then there is not much need, no.
>>
>
> I guess I was not expecting users trying to write portable JDBC code to
> write code that referred to PG specific classes. Do other people do this?
Absolutely not!
>
>> The UNDEFINED_OBJECT constant is a little trickier. I use it to patch
>> the driver for the Atomikos XA testsuite. I've already submitted that
>> patch but do understand your reluctance to accept it since its
>> validity is not immediately apparent.
>
> I've got to admit that I haven't really looked into that one, but if you
> are patching the driver to fix that, then there's no reason that patch
> couldn't touch PSQLState as well.
>
> Kris Jurka
>
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: danap@ttc-cmc.net
Subject: Re: Patch: Some more state codes
In-Reply-To: <4E6A27C2.6060508@ttc-cmc.net>
References: <x6sjo8bbe4.fsf@2ndquadrant.com> <alpine.BSO.2.00.1109071229020.27523@leary.csoft.net> <x6bouwavk9.fsf@2ndquadrant.com> <alpine.BSO.2.00.1109091019350.4040@leary.csoft.net> <4E6A27C2.6060508@ttc-cmc.net>
* 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