Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3F2E79FB313 for ; Mon, 16 Jul 2007 04:41:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 76175-09 for ; Mon, 16 Jul 2007 04:41:14 -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 C81EF9FB284 for ; Mon, 16 Jul 2007 04:41:25 -0300 (ADT) Received: (qmail 16502 invoked by uid 681007); 16 Jul 2007 07:41:16 -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 07:41:16 -0000 Message-ID: <469B2117.2010504@lewczuk.com> Date: Mon, 16 Jul 2007 09:41:11 +0200 From: Marek Lewczuk User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Oliver Jowett CC: Kris Jurka , pgsql-jdbc@postgresql.org Subject: Re: patch - support for multi-dimensional arrays and NULL values References: <46913F83.6030806@lewczuk.com> <4691F928.9010000@lewczuk.com> <469B0F0F.2070700@opencloud.com> In-Reply-To: <469B0F0F.2070700@opencloud.com> 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/69 X-Sequence-Number: 17243 Oliver Jowett pisze: > I was wondering which behaviour was right -- I thought returning > array-of-primitive was correct per the spec at the time I wrote it, and > that's why getArray() returns Object not Object[] -- but now the 1.6 > javadoc says: > >> Note: When getArray is used to materialize a base type that maps to a >> primitive data type, then it is implementation-defined whether the >> array returned is an array of that primitive data type or an array of >> Object. > > So I suppose that .. in theory .. applications should be expecting to > handle both. Ugh. My opinion is that we should keep BC either by building two different jdbc versions or checking PG version every time getArray() is used (if < 8.2 then primitive types are used, if >= 8.2 then objects). Second option is quite good, although it doesn't guaranty full BC - let assume that someone is using jdbc application that was written for pg 8.0, but after update to 8.2 the code with following statement: (boolean[]) getArray() would cause cast exception (Cannot cast from Boolean[] to boolean[]). Regards, ML