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 30ADB329ED9 for ; Tue, 5 Oct 2004 21:57:33 +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 51355-04 for ; Tue, 5 Oct 2004 20:57:22 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9E132329ED5 for ; Tue, 5 Oct 2004 21:57:22 +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 1CEwN3-0007Gy-00; Wed, 06 Oct 2004 09:57:17 +1300 Message-ID: <41630AAB.7080501@opencloud.com> Date: Wed, 06 Oct 2004 09:57:15 +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: Kris Jurka Cc: Johann Robette , pgsql-jdbc@postgresql.org Subject: Re: Postgres 8.0 + JDBC References: <002901c4aaf7$feabc310$a5010a0a@Johann> <4162FFC9.3010808@opencloud.com> In-Reply-To: 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/18 X-Sequence-Number: 11123 Kris Jurka wrote: > > On Wed, 6 Oct 2004, Oliver Jowett wrote: > > >>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. >> > > > Wouldn't it be simpler to change setArray to call setString with 0 as the > type oid allowing the backend to figure out what to do with it? Perhaps > it would have trouble determining the type if the underlying function was > overloaded, but other than that I don't see a problem. Using the unknown oid seems like it'd introduce more problems: overloading, and the possibility you actually pass your array as some other type unexpectedly. I am wondering if the right way to find the array OID is to prepend "_" and search on pg_type.typname, or to look for pg_type.typinput = (oid of array_in) and pg_type.typelem = (oid of underlying type). Is there a 'standard' way of finding an array type OID? -O