X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B90769DC93C for ; Tue, 28 Mar 2006 13:09:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09773-04 for ; Tue, 28 Mar 2006 13:09:53 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id ED0069DC894 for ; Tue, 28 Mar 2006 13:09:52 -0400 (AST) Received: from black.invalid (c-24-91-49-146.hsd1.ma.comcast.net [24.91.49.146]) by svr4.postgresql.org (Postfix) with ESMTP id 1E05C5AF84A for ; Tue, 28 Mar 2006 17:09:52 +0000 (GMT) Received: from black.invalid (localhost.localdomain [127.0.0.1]) by black.invalid (8.13.6/8.13.4) with ESMTP id k2SH9NBj032524 for ; Tue, 28 Mar 2006 12:09:23 -0500 Received: (from apache@localhost) by black.invalid (8.13.6/8.13.6/Submit) id k2SH9MYC032523 for pgsql-jdbc@postgresql.org; Tue, 28 Mar 2006 12:09:22 -0500 X-Authentication-Warning: black.invalid: apache set sender to jao@geophile.com using -f Received: from 64.119.142.34 ([64.119.142.34]) by geophile.com (Horde MIME library) with HTTP; Tue, 28 Mar 2006 12:09:22 -0500 Message-ID: <20060328120922.j4j45ztgsgc4go40@geophile.com> Date: Tue, 28 Mar 2006 12:09:22 -0500 From: jao@geophile.com To: pgsql-jdbc@postgresql.org Subject: Array support in 8.1 JDBC driver MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.4) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.697 required=5 tests=[AWL=0.147, NO_REAL_NAME=0.55] X-Spam-Score: 0.697 X-Spam-Level: X-Archive-Number: 200603/130 X-Sequence-Number: 14911 I am using postgres 7.4 with an 8.1 JDBC driver. I am considering whether I should use postgres arrays, and a key issue is JDBC support. I found this comment about the 7.4 driver from Oliver Jowett (http://archives.postgresql.org/pgsql-jdbc/2004-11/msg00141.php): The driver does not really support setArray() / updateArray() for arbitary Array implementations. I had a patch to fix this ages ago but it has rotted since then, and was never really the right way to do it anyway. The 8.1 release notes for dev307 say this, which seems to imply better support: Fix setArray when using the v3 protocol. We can't bind arrays as text, we need the correct type. This gets the array type from the Array.getBaseType method. This is a fragile means that depends on a specific Array implementation, but we already depend on a very specific implementation (toString() returning a correctly formatted pg array) that we can live with this. (oliver) I'm not sure I understand this. It sounds like the array is converted to a string. Is the string then just pasted into the query? What does this to to the use of server-side prepared statements? I'd like to avoid parsing the "same" statement repeatedly due to the use of arrays. Or is the string then somehow used to bind an array to the prepared statement? I don't have to use postgres array, and if the driver will introduce lots of string manipulation, I'll probably do something else. Jack Orenstein