Re: Modify the DECLARE CURSOR command tag depending on the scrollable flag - Mailing list pgsql-hackers

From Boszormenyi Zoltan
Subject Re: Modify the DECLARE CURSOR command tag depending on the scrollable flag
Date
Msg-id 5298288A.7050804@cybertec.at
Whole thread Raw
In response to Re: Modify the DECLARE CURSOR command tag depending on the scrollable flag  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
2013-11-29 04:56 keltezéssel, Peter Eisentraut írta:
> On Wed, 2013-11-27 at 18:17 -0500, Tom Lane wrote:
>> Hm.  So you're suggesting that ECPG fix this problem by inserting an
>> explicit NO SCROLL clause into translated DECLARE CURSOR commands, if
>> there's not a SCROLL clause?
> I wouldn't go that far yet.
>
> Do I understand this right that the future readahead code needs separate
> behavior depending on whether a cursor is scrollable?

The same code is used.

However, when the cursor is not scrollable, it returns an error early
to the application when it wants to go backward. It still allows
FETCH/MOVE ABSOLUTE to an earlier position just like the backend,
in which case scanning the cursor is restarted from the beginning.

If the cursor is not scrollable, the readahead code must not serve
tuples from the currently populated cache backward. If the cursor
is scrollable, FETCH BACKWARD is served from the cache.

>    I would think
> that whatever you do with NO SCROLL cursors would also work with SCROLL
> cursors, so if you don't know what the cursor is, just use the code for
> NO SCROLL.
>
>
>
>


-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de     http://www.postgresql.at/




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block
Next
From: Robert Haas
Date:
Subject: Re: logical changeset generation v6.7