Re: patch - support for multi-dimensional arrays and NULL values

Поиск
Список
Период
Сортировка
От Marek Lewczuk
Тема Re: patch - support for multi-dimensional arrays and NULL values
Дата
Msg-id 469B1180.4030305@lewczuk.com
обсуждение исходный текст
Ответ на Re: patch - support for multi-dimensional arrays and NULL values  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
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




В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: patch - support for multi-dimensional arrays and NULL values
Следующее
От: "Kalle Hallivuori"
Дата:
Сообщение: Re: Stream Copy for 8.1 - 8.3dev