Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 35E9FB5DBF0 for ; Fri, 9 Sep 2011 11:54:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 89880-04 for ; Fri, 9 Sep 2011 14:54:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id A0E04B5DBFC for ; Fri, 9 Sep 2011 11:54:40 -0300 (ADT) Received: from [192.168.157.132] (unknown [76.75.27.41]) by outbound.vnet-inc.com (Postfix) with ESMTP id 9A240596C for ; Fri, 9 Sep 2011 08:54:40 -0600 (MDT) Message-ID: <4E6A27C2.6060508@ttc-cmc.net> Date: Fri, 09 Sep 2011 08:50:42 -0600 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: PostgreSQL JDBC Subject: Re: Patch: Some more state codes References: In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/25 X-Sequence-Number: 22143 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 >