Re: [JDBC] V3 protocol + DECLARE problems

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [JDBC] V3 protocol + DECLARE problems
Date: 2004-07-22 15:13:12
Message-ID: 9813.1090509192@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Oliver Jowett <oliver(at)opencloud(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-07-22 20:19:53 Re: [HACKERS] Point in Time Recovery
Previous Message Chris Browne 2004-07-22 15:04:06 psql support for "DSNs"

Browse pgsql-jdbc by date

  From Date Subject
Next Message Phil Moors 2004-07-22 15:14:57 Re: SSL URL
Previous Message Oliver Jowett 2004-07-22 11:32:16 Re: [JDBC] V3 protocol + DECLARE problems