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 48CF232A062 for ; Wed, 6 Oct 2004 08:20:56 +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 95292-04 for ; Wed, 6 Oct 2004 07:20:44 +0000 (GMT) Received: from dns.cegetel-passerelle.com (dns.cegetel-passerelle.com [213.223.187.134]) by svr1.postgresql.org (Postfix) with ESMTP id CA6EE329DF7 for ; Wed, 6 Oct 2004 08:20:44 +0100 (BST) Received: from escmail.esc-lille.fr (unknown [213.223.237.160]) by dns.cegetel-passerelle.com (Postfix) with ESMTP id B418225854 for ; Wed, 6 Oct 2004 09:20:42 +0200 (CEST) Received: from srvmail.esc-lille.fr (srvmail.esc-lille.fr [10.1.10.5]) by escmail.esc-lille.fr (Postfix) with ESMTP id 6B17867C137 for ; Wed, 6 Oct 2004 09:19:45 +0200 (CEST) Received: from Johann ([10.10.1.165]) by srvmail.esc-lille.fr with Microsoft SMTPSVC(5.0.2195.6713); Wed, 6 Oct 2004 09:20:37 +0200 From: "Johann Robette" To: "'Oliver Jowett'" Cc: Subject: RE : Postgres 8.0 + JDBC Date: Wed, 6 Oct 2004 09:20:37 +0200 Message-ID: <005a01c4ab74$fd193460$a5010a0a@Johann> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <4162FFC9.3010808@opencloud.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-OriginalArrivalTime: 06 Oct 2004 07:20:37.0300 (UTC) FILETIME=[FA0E1740:01C4AB74] 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/21 X-Sequence-Number: 11126 OK Thanks a lot for your answer. But as I'm a newbie in this field, could you give me an example of how to do that. I've already checked the array typename and it is "_text". You said :=20 "It seems possible to fix the driver to handle this case by making=20 setArray() derive a proper array type name i.e. ("_" +=20 Array.getBaseType()), and using that rather than 'text' as the parameter type." How to do that? Thanks JR -----Message d'origine----- De=A0: Oliver Jowett [mailto:oliver@opencloud.com]=20 Envoy=E9=A0: mardi 5 octobre 2004 22:11 =C0=A0: Johann Robette Cc=A0: pgsql-jdbc@postgresql.org Objet=A0: Re: [JDBC] Postgres 8.0 + JDBC Johann Robette wrote: > java.sql.SQLException: ERROR: cannot cast type text to > text[] setArray has never worked particularly well; you're seeing another=20 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=20 protocol, with type =3D 'text' - apparently you can't cast directly from text -> text[] (although you=20 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=20 setArray() derive a proper array type name i.e. ("_" +=20 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=20 into the official driver. -O