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 0FE209DCAAC for ; Mon, 5 Dec 2005 16:27:41 -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 43140-05 for ; Mon, 5 Dec 2005 16:27:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 4185B9DCD21 for ; Mon, 5 Dec 2005 16:27:36 -0400 (AST) Received: (qmail invoked by alias); 05 Dec 2005 20:27:36 -0000 Received: from 85-124-6-194.dynamic.xdsl-line.inode.at (EHLO zaphod) [85.124.6.194] by mail.gmx.net (mp034) with SMTP; 05 Dec 2005 21:27:36 +0100 X-Authenticated: #1946847 Message-ID: <024401c5f9da$537c29c0$0f01a8c0@zaphod> From: "Michael Paesold" To: Subject: Problem with 8.1 driver Date: Mon, 5 Dec 2005 21:27:34 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/16 X-Sequence-Number: 14347 Hi, I am running postgresql-8.1-404.jdbc3.jar against server version 7.4.7, which I want to eventually upgrade to 8.1. Right now I am testing our application with the 8.1 driver and found an issue with a prepared query. (Btw. I am using a regular connection URL without any special parameters set.) The offending code looks like this: String DELETE_QUERY = "DELETE FROM server_log WHERE level_value" + " <= ? AND event_time < NOW() - interval ?"; PreparedStatement stmt = con.prepareStatement(DELETE_QUERY); stmt.setInt(1, level.intValue()); stmt.setString(2, "1 day"); int deleted = stmt.executeUpdate(); Using the 7.4 driver this worked just fine. Now with the new driver I get: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$2" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:300) ... Server statement log shows: DELETE FROM server_log WHERE level_value <= $1 AND event_time < NOW() - interval $2 Is this a bug, or is the driver just not compatible with the server? Should not be so because both speak the V3 protocol. Thanks for your help. Best Regards, Michael Paesold