pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marek Lewczuk <newsy@lewczuk.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: 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 09:41:11 +0200
Message-ID: <469B2117.2010504@lewczuk.com> (raw)
In-Reply-To: <469B0F0F.2070700@opencloud.com>
References: <46913F83.6030806@lewczuk.com>
	<4691F928.9010000@lewczuk.com>
	<Pine.BSO.4.64.0707160030520.28414@leary.csoft.net>
	<469B0F0F.2070700@opencloud.com>

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:
<code>(boolean[]) getArray()</code>
would cause cast exception (Cannot cast from Boolean[] to boolean[]).

Regards,
ML







view thread (9+ messages)  latest in thread

Message-ID: <469B2117.2010504@lewczuk.com>
Permalink:  ../469B2117.2010504@lewczuk.com/
Also on:    postgresql.org/message-id/469B2117.2010504@lewczuk.com

 · 

reply

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, oliver@opencloud.com, books@ejurka.com
  Subject: Re: patch - support for multi-dimensional arrays and NULL values
  In-Reply-To: <469B2117.2010504@lewczuk.com>
  References: <46913F83.6030806@lewczuk.com> <4691F928.9010000@lewczuk.com> <Pine.BSO.4.64.0707160030520.28414@leary.csoft.net> <469B0F0F.2070700@opencloud.com> <469B2117.2010504@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