From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [JDBC] V3 protocol + DECLARE problems
Date: Sun, 25 Jul 2004 18:37:52 +1200
Message-ID: <41035540.9020608@opencloud.com> (raw)
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>
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
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: oliver@opencloud.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
Subject: Re: [JDBC] V3 protocol + DECLARE problems
In-Reply-To: <41035540.9020608@opencloud.com>
References: <40FD982D.2080006@opencloud.com> <9141.1090424549@sss.pgh.pa.us> <40FFA5C0.7050701@opencloud.com> <9813.1090509192@sss.pgh.pa.us> <41035540.9020608@opencloud.com>
* 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