Re: [JDBC] V3 protocol + DECLARE problems - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [JDBC] V3 protocol + DECLARE problems
Date
Msg-id 9813.1090509192@sss.pgh.pa.us
Whole thread Raw
In response to Re: [JDBC] V3 protocol + DECLARE problems  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: [JDBC] V3 protocol + DECLARE problems  (Oliver Jowett <oliver@opencloud.com>)
Re: [JDBC] V3 protocol + DECLARE problems  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-hackers
Oliver Jowett <oliver@opencloud.com> 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-win32] Weird new time zone
Next
From: Bruce Momjian
Date:
Subject: Release notes