From: Marek Lewczuk <newsy@lewczuk.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: patch - support for multi-dimensional arrays and NULL values
Date: Mon, 16 Jul 2007 08:34:40 +0200
Message-ID: <469B1180.4030305@lewczuk.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0707160030520.28414@leary.csoft.net>
References: <46913F83.6030806@lewczuk.com>
<4691F928.9010000@lewczuk.com>
<Pine.BSO.4.64.0707160030520.28414@leary.csoft.net>
Kris Jurka pisze:
> I gave this a read and have some comments:
>
> 1) Your null checking needs to be version dependent. Releases prior to
> 8.2 do not support null elements and you'll get:
>
> # select array['a','NULL'];
> array
> ----------
> {a,NULL}
> (1 row)
Right, I will fix that.
> 2) Changing from returning arrays of primitive types to arrays of
> objects is necessary for null and multi-dimension support, but will
> still break users code all over the place. Not sure what we can do
> about that other than put a strong warning in the release notes.
For sure BC is important issue and maybe I should check PG version and
if it is < 8.2 then primitive arrays should be returned (just like
before - it needs only more code, but won't break current applications) ?
> 3) A lot of the code doesn't look like it handles multiple dimensions.
> What about things like fillIntegerResultSet? No that we're dealing with
> objects can't we abstract a lot of these copies away and provide one
> implementation that is multi-dimension aware? If you do
> Array.getResultSet you should be able to call ResultSet.getArray and the
> getResultSet on that, right?
Currently my patch applies only to java.sql.Array.getArray() and because
I didn't know what is your opinion about my implementation I didn't
patch any other methods (like java.sql.Array.getResultSet()). If you say
that my implementation + fixes proposed above are OK then I will make a
patch for other methods in order to provide full support of
java.sql.Array. Methods from AbstractJdbc2Array (like
fillIntegerResultSet()) either will be removed or fixed in order to work
with all those changes.
Best wishes,
Marek
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: newsy@lewczuk.com, books@ejurka.com
Subject: Re: patch - support for multi-dimensional arrays and NULL values
In-Reply-To: <469B1180.4030305@lewczuk.com>
References: <46913F83.6030806@lewczuk.com> <4691F928.9010000@lewczuk.com> <Pine.BSO.4.64.0707160030520.28414@leary.csoft.net> <469B1180.4030305@lewczuk.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