Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 396FC2E0333 for ; Wed, 19 Dec 2007 05:18:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 94273-09 for ; Wed, 19 Dec 2007 05:18:29 -0400 (AST) Received: from fep01.xtra.co.nz (fep01.xtra.co.nz [210.54.141.245]) by postgresql.org (Postfix) with ESMTP id 2F86E2E0185 for ; Wed, 19 Dec 2007 05:18:28 -0400 (AST) Received: from mta04.xtra.co.nz ([172.23.11.41]) by fep01.xtra.co.nz with ESMTP id <20071219091827.MAHE29570.fep01.xtra.co.nz@mta04.xtra.co.nz> for ; Wed, 19 Dec 2007 22:18:27 +1300 Received: from fep03.xtra.co.nz ([172.23.12.31]) by mta04.xtra.co.nz with ESMTP id <20071219091827.HOOC28381.mta04.xtra.co.nz@fep03.xtra.co.nz> for ; Wed, 19 Dec 2007 22:18:27 +1300 Received: from x1000.msqr.us ([125.236.166.246]) by fep03.xtra.co.nz with ESMTP id <20071219091827.FTQH18083.fep03.xtra.co.nz@x1000.msqr.us> for ; Wed, 19 Dec 2007 22:18:27 +1300 Received: from x1000.msqr.us (x1000.msqr.us [127.0.0.1]) by x1000.msqr.us (8.13.1/8.13.1) with ESMTP id lBJ9IPUa026772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 19 Dec 2007 22:18:26 +1300 Received: (from apache@localhost) by x1000.msqr.us (8.13.1/8.13.1/Submit) id lBJ9IP6d026771; Wed, 19 Dec 2007 22:18:25 +1300 Received: from 192.168.1.108 (SquirrelMail authenticated user matt) by msqr.us with HTTP; Wed, 19 Dec 2007 22:18:25 +1300 (NZDT) Message-ID: <55255.192.168.1.108.1198055905.squirrel@msqr.us> Date: Wed, 19 Dec 2007 22:18:25 +1300 (NZDT) Subject: setting PreparedStatement parameter using "at time zone interval ?" From: "Matt Magoffin" To: pgsql-jdbc@postgresql.org User-Agent: SquirrelMail/1.4.8-4.0.1.el4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/142 X-Sequence-Number: 17997 I'm using the latest 8.3 development driver against an 8.3 database. I thought back in 8.1 I used to be able to use a PreparedStatement that included something like ... date(l.created AT TIME ZONE INTERVAL ?) but now I am always getting an exception like org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1" I found if I changed the query to use this syntax: ... date(timezone(?::interval, l.created)) it worked fine. Should the former syntax be supported by the JDBC driver? -- m@