Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DEC38634DBF for ; Sun, 21 Jun 2009 21:14:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 00948-03-5 for ; Sun, 21 Jun 2009 21:14:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id BED57634119 for ; Sun, 21 Jun 2009 21:11:42 -0300 (ADT) Received: from 219-89-243-186.adsl.xtra.co.nz ([219.89.243.186] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MIX8K-0006MY-7q; Mon, 22 Jun 2009 12:11:36 +1200 Message-ID: <4A3ECC37.5080000@opencloud.com> Date: Mon, 22 Jun 2009 12:11:35 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: BlackMage CC: pgsql-jdbc@postgresql.org Subject: Re: Inserting Information in PostgreSQL interval References: <24139349.post@talk.nabble.com> In-Reply-To: <24139349.post@talk.nabble.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/77 X-Sequence-Number: 19741 BlackMage wrote: > query.setObject(1, "{28.1, 29.2}"); > org.postgresql.util.PSQLException: ERROR: column "field_1" is of type > interval[] but expression is of type character varying The two-argument form of setObject() infers a type of Types.VARCHAR for a java.lang.String (see the JDBC spec) > So is there another way of entering an array of intervals into a postgresql > database using prepared statement? What am I doing wrong? Try: query.setObject(1, "{28.1, 29.2}", Types.OTHER); -O