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 2C41C53CC1 for ; Thu, 28 Apr 2005 11:26:50 -0300 (ADT) 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 27607-07 for ; Thu, 28 Apr 2005 14:26:48 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 1AB9453C9E for ; Thu, 28 Apr 2005 11:26:47 -0300 (ADT) Received: (qmail 28053 invoked by uid 1112); 28 Apr 2005 14:26:52 -0000 Date: Thu, 28 Apr 2005 09:26:52 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Thomas O'Dowd Cc: pgsql-jdbc@postgresql.org Subject: Re: Array support In-Reply-To: <1114680320.8404.88.camel@localhost.localdomain> Message-ID: References: <1114094185.26958.22.camel@localhost.localdomain> <42681D28.6060408@opencloud.com> <1114680320.8404.88.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/200 X-Sequence-Number: 12807 On Thu, 28 Apr 2005, Thomas O'Dowd wrote: > 1. I tried to use the syntax ARRAY['one'] in the string returned by > toString(). This fails with the server error: > > array value must start with "{" or dimension information > > So it looks like that format is not supported by server side prepared > statements. Right, the ARRAY[] syntax is part of the parser which doesn't get invoked on parameters, so you need to use the {} format. > 2. How do you set an array to null? I tried: > PreparedStatement.setNull(index, java.sql.Types.ARRAY); > but it throws the exception > > org.postgresql.util.PSQLException: Unknown Types value. > at org.postgresql.jdbc2.AbstractJdbc2Statement.setNull(AbstractJdbc2Statement.java:1003) > > Q: How do I set an array column to null using a PreparedStatement? This is indeed a bug, I've fixed this in the 8.0 + head branches. Updated jar files are available here: http://www.ejurka.com/pgsql/jars/tod/ Kris Jurka