Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DE8B79FB368 for ; Mon, 16 Jul 2007 03:34:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34909-06 for ; Mon, 16 Jul 2007 03:34:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp.host.kei.pl (v681.rev.tld.pl [195.149.226.81]) by postgresql.org (Postfix) with ESMTP id 61C7B9FB2C8 for ; Mon, 16 Jul 2007 03:34:54 -0300 (ADT) Received: (qmail 6324 invoked by uid 681007); 16 Jul 2007 06:34:43 -0000 X-clamdmail: clamdmail 0.18a Received: from linux.samar.pl (HELO ?172.16.1.38?) (marek@lewczuk.com@87.204.17.90) by smtp.host.kei.pl with ESMTPA; 16 Jul 2007 06:34:43 -0000 Message-ID: <469B1180.4030305@lewczuk.com> Date: Mon, 16 Jul 2007 08:34:40 +0200 From: Marek Lewczuk User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-jdbc@postgresql.org Subject: Re: patch - support for multi-dimensional arrays and NULL values References: <46913F83.6030806@lewczuk.com> <4691F928.9010000@lewczuk.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/67 X-Sequence-Number: 17241 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