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 55565D1B1CF; Tue, 20 Jul 2004 19:09:53 -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 60297-01; Tue, 20 Jul 2004 22:09:52 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 4439CD1B199; Tue, 20 Jul 2004 19:09:48 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Bn2o3-0002BC-00; Wed, 21 Jul 2004 10:09:51 +1200 Message-ID: <40FD982D.2080006@opencloud.com> Date: Wed, 21 Jul 2004 10:09:49 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "pgsql-jdbc@postgresql.org" Cc: pgsql-hackers@postgresql.org Subject: V3 protocol + DECLARE problems Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS, TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200407/243 X-Sequence-Number: 10627 (cc: -hackers as I think this has been raised there before) It's going to be fun using anything more than very basic cursors via the V3 protocol in the JDBC driver. DECLARE does not work with parameters passed via a Parse/Bind combination -- which is how we currently always pass parameters when talking V3. I'm reluctant to have two implementations of the parameter logic for V3 (one that does direct substitution, one that uses Bind) since that's extra unnecessary code and a recipe for inconsistent behaviour. Logs follow; basically this is issuing a Parse/Bind/Execute for a parameterized DECLARE, which blows up with "no value found for parameter 1" despite there definitely being one there. (also, that error appears on Execute, not Parse/Bind). Any chance of getting this fixed for 7.5? Alternatively, if we can get WITH HOLD / SCROLL behaviour in portals created by Execute (probably means a protocol change) that works too. I don't have a runnable 7.5 on hand to test against so it's possible this has already been fixed. -O > Trying to establish a protocol version 3 connection to localhost:5432 > FE=> StartupPacket(user=oliver, database=test, client_encoding=UNICODE, DateStyle=ISO) > <=BE AuthenticationOk > <=BE ParameterStatus(client_encoding = UNICODE) > <=BE ParameterStatus(DateStyle = ISO, DMY) > <=BE ParameterStatus(is_superuser = off) > <=BE ParameterStatus(server_version = 7.4.1) > <=BE ParameterStatus(session_authorization = oliver) > <=BE BackendKeyData(pid=676,ckey=704988999) > <=BE ReadyForQuery(I) > compatible = 7.5 > loglevel = 0 > prepare threshold = 0 > getConnection returning driver[className=org.postgresql.Driver,org.postgresql.Driver@ad3ba4] > simple execute, handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler@1dd7056, maxRows=0, fetchSize=0, flags=21 > FE=> Parse(stmt=null,query="DECLARE c CURSOR WITH HOLD FOR SELECT typname,oid from pg_type WHERE typname LIKE $1",oids={25}) > FE=> Bind(stmt=null,portal=null,$1=<%>) > FE=> Describe(portal=null) > FE=> Execute(portal=null,limit=1) > FE=> Sync > <=BE ParseComplete [null] > <=BE BindComplete [null] > <=BE NoData > <=BE CommandStatus(DECLARE CURSOR) > <=BE ErrorMessage(ERROR: no value found for parameter 1 > Location: File: execQual.c, Routine: ExecEvalParam, Line: 518 > ServerSQLState: 42704) > java.sql.SQLException: ERROR: no value found for parameter 1 > Location: File: execQual.c, Routine: ExecEvalParam, Line: 518 > ServerSQLState: 42704 > at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1130) > at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:933) > at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:139) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:343) > at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:291) > at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:246) > at TestDeclare.main(TestDeclare.java:11) > SQLException: SQLState(42704) > <=BE NoticeResponse(WARNING: AbortTransaction and not in in-progress state > Location: File: xact.c, Routine: AbortTransaction, Line: 1034 > ServerSQLState: 01000) > SQLWarning: > <=BE ReadyForQuery(I)