Re: Updateable cursors - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Updateable cursors
Date
Msg-id 19170.1169566765@sss.pgh.pa.us
Whole thread Raw
In response to Re: Updateable cursors  ("Simon Riggs" <simon@2ndquadrant.com>)
Responses Re: Updateable cursors  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> On Tue, 2007-01-23 at 09:55 -0500, Tom Lane wrote:
>> This really isn't gonna work, because it assumes that the tuple that is
>> "current" at the instant of parsing is still going to be "current" at
>> execution time.

> Of course thats true, but you've misread my comment.

> The portal with the cursor in will not change, no matter how many times
> we execute WHERE CURRENT OF in another portal.

Really?  The cursor portal will cease to exist as soon as the
transaction ends, but the prepared plan won't.  A reasonable person
would expect that WHERE CURRENT OF will parse into a plan that just
stores the cursor name, and looks up the cursor at execution time.

> The OP suggested putting
> the current tuple pointer onto the portal data, so this will work.

No, as I read his message he was suggesting pulling data out of the
cursor portal at plan time so that no downstream (executor) changes
would be needed.  That is certainly never going to be workable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: STOP all user access except for admin for a few minutes?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: 10 weeks to feature freeze (Pending Work)