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 2AA86D1B1C9 for ; Sun, 25 Jul 2004 03:37:59 -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 68782-08 for ; Sun, 25 Jul 2004 06:38:01 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 1D879D1B18C for ; Sun, 25 Jul 2004 03:37:52 -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 1Bocdu-0006qG-00; Sun, 25 Jul 2004 18:37:54 +1200 Message-ID: <41035540.9020608@opencloud.com> Date: Sun, 25 Jul 2004 18:37:52 +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: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: [JDBC] V3 protocol + DECLARE problems References: <40FD982D.2080006@opencloud.com> <9141.1090424549@sss.pgh.pa.us> <40FFA5C0.7050701@opencloud.com> <9813.1090509192@sss.pgh.pa.us> In-Reply-To: <9813.1090509192@sss.pgh.pa.us> 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 X-Spam-Level: X-Archive-Number: 200407/1177 X-Sequence-Number: 56738 Tom Lane wrote: > 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.) I've done this and it seems to work fine for the V3 protocol case. However there are some callers of ProcessUtility that do not set ActivePortal: SPI and the SQL function code. These suffer from essentially the same problem as with the V3 protocol, for example: > test=# create function f1(text) returns void as $$ > test$# declare c cursor for select * from pg_type where typname like $1; > test$# $$ language sql; > CREATE FUNCTION > test=# begin; > BEGIN > test=# select f1('%'); > f1 > ---- > > (1 row) > > test=# fetch all from c; > ERROR: no value found for parameter 1 SPI has a similar path via SPI_execp -> _SPI_execute_plan. So it looks like I'll have to go back to passing a parameter list to ProcessUtility; even if we don't need to support the SPI/SQL function cases, it seems that ActivePortal is not guaranteed to point to the right parameter values. -O