pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [JDBC] V3 protocol + DECLARE problems
Date: Thu, 22 Jul 2004 11:13:12 -0400
Message-ID: <9813.1090509192@sss.pgh.pa.us> (raw)
In-Reply-To: <40FFA5C0.7050701@opencloud.com>
References: <40FD982D.2080006@opencloud.com>
	<9141.1090424549@sss.pgh.pa.us>
	<40FFA5C0.7050701@opencloud.com>

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



view thread (10+ messages)  latest in thread

Message-ID: <9813.1090509192@sss.pgh.pa.us>
Permalink:  ../9813.1090509192@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9813.1090509192@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, oliver@opencloud.com, pgsql-hackers@postgresql.org
  Subject: Re: [JDBC] V3 protocol + DECLARE problems
  In-Reply-To: <9813.1090509192@sss.pgh.pa.us>
  References: <40FD982D.2080006@opencloud.com> <9141.1090424549@sss.pgh.pa.us> <40FFA5C0.7050701@opencloud.com> <9813.1090509192@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox