pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Thu, 22 Jul 2004 23:32:16 +1200
Message-ID: <40FFA5C0.7050701@opencloud.com> (raw)
In-Reply-To: <9141.1090424549@sss.pgh.pa.us>
References: <40FD982D.2080006@opencloud.com>
	<9141.1090424549@sss.pgh.pa.us>

Tom Lane wrote:

[... DECLARE with parameters failing ...]

>>Any chance of getting this fixed for 7.5?
> 
> 
> I'm up to my keister in PITR and nested-xact issues and won't have time
> to look at it soon.  Do you want to take a look and see if you can find
> where the ball is getting dropped?

Here's what I've found so far:

The error occurs where it does because it is a DECLARE CURSOR WITH HOLD 
outside an explicit transaction, so the resulting cursor is immediately 
materialized when the implicit commit at end of statement happens. This 
implicitly fetches all rows, and it's the fetch that fails.

When the DECLARE is enclosed in an explicit transaction, it succeeds, 
but then subsequent FETCHes fail with the same error.

DECLARE -> PerformCursorOpen always passes NULL as a parameter list to 
PortalStart() on the newly created portal, so no parameters are 
available when executing it.

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?

-O



view thread (10+ messages)  latest in thread

Message-ID: <40FFA5C0.7050701@opencloud.com>
Permalink:  ../40FFA5C0.7050701@opencloud.com/
Also on:    postgresql.org/message-id/40FFA5C0.7050701@opencloud.com

 · 

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