X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 328B2D1B23E for ; Thu, 22 Jul 2004 12:13:23 -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 92934-05 for ; Thu, 22 Jul 2004 15:13:16 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 21FFBD1B16E for ; Thu, 22 Jul 2004 12:13:15 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6MFDCPO009814; Thu, 22 Jul 2004 11:13:12 -0400 (EDT) To: Oliver Jowett Cc: pgsql-hackers@postgresql.org Subject: Re: [JDBC] V3 protocol + DECLARE problems In-reply-to: <40FFA5C0.7050701@opencloud.com> References: <40FD982D.2080006@opencloud.com> <9141.1090424549@sss.pgh.pa.us> <40FFA5C0.7050701@opencloud.com> Comments: In-reply-to Oliver Jowett message dated "Thu, 22 Jul 2004 23:32:16 +1200" Date: Thu, 22 Jul 2004 11:13:12 -0400 Message-ID: <9813.1090509192@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/1116 X-Sequence-Number: 56677 Oliver Jowett writes: > It seems like we should pass the original parameters from execution of > the DECLARE utility portal down through PortalRunUtility -> > ProcessUtility -> PerformCursorOpen, copy them into the newly created > portal's memory context, and pass the copies to PortalStart on the new > portal. > Does that sound about right? Hm. The copying bit bothers me, and I guess after some thought it's a semantic issue. If you've got DECLARE c CURSOR FOR SELECT ... WHERE foo = $1; FETCH 10 FROM c; it's not very clear when the value of $1 should be supplied. With your proposal the parameter value would have to be supplied in the Bind message for the DECLARE CURSOR command. That may be the only way to do it (certainly I'd not want several successive FETCHes to use different parameter values), but it still seems a bit weird. BTW, rather than hacking the parameter list of ProcessUtility, I'd be inclined to just look at ActivePortal->portalParams in PerformCursorOpen. (Come to think of it, we could also copy ActivePortal's sourceText at the PortalDefineQuery step.) regards, tom lane