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/



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to