X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A342C32A1AE for ; Tue, 5 Oct 2004 21:11:47 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33856-10 for ; Tue, 5 Oct 2004 20:11:40 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 3DBF032A1AD for ; Tue, 5 Oct 2004 21:11:39 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CEve9-00074u-00; Wed, 06 Oct 2004 09:10:53 +1300 Message-ID: <4162FFC9.3010808@opencloud.com> Date: Wed, 06 Oct 2004 09:10:49 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Johann Robette Cc: pgsql-jdbc@postgresql.org Subject: Re: Postgres 8.0 + JDBC References: <002901c4aaf7$feabc310$a5010a0a@Johann> In-Reply-To: <002901c4aaf7$feabc310$a5010a0a@Johann> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/15 X-Sequence-Number: 11120 Johann Robette wrote: > java.sql.SQLException: ERROR: cannot cast type text to > text[] setArray has never worked particularly well; you're seeing another manifestation here. The underlying problem here is that: - setArray() is claiming that the type it is setting is a VARCHAR - the parameter is being passed as a typed parameter via the V3 protocol, with type = 'text' - apparently you can't cast directly from text -> text[] (although you can interpret an untyped literal as text[], which is why it worked before). It seems possible to fix the driver to handle this case by making setArray() derive a proper array type name i.e. ("_" + Array.getBaseType()), and using that rather than 'text' as the parameter type. I'll try to do this soon, but I'm a bit busy so it may be a few days. A longer term fix is to properly implement array support in setArray().. I've submitted patches in the past to do this but they've never made it into the official driver. -O