Re: BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: eric.cyr@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2023-04-29T22:50:24Z
Lists: pgsql-bugs
Etsuro Fujita <etsuro.fujita@gmail.com> writes: >> I think that the root cause is in commit d844cd75a, which disallowed >> rewinding and then re-fetching forwards in a NO SCROLL cursor. I am >> not sure what to do about this issue, but I am wondering whether that >> commit is too restrictive, because 1) these examples would work just >> fine without that commit, and 2) we still allow >> rewind-and-fetch-forwards in a SCROLL cursor even when the query >> includes volatile functions. Well, the short answer here is that postgres_fdw is depending on something that has squishy semantics, for the reasons enumerated in d844cd75a (see also [1]). Maybe we can carve out an exception that's narrow enough that we can convince ourselves it's not squishy, but I'm not very sure what the rules should be. regards, tom lane [1] https://www.postgresql.org/message-id/201144.1682350828%40sss.pgh.pa.us
Commits
-
postgres_fdw: Avoid "cursor can only scan forward" error.
- f39f3e0fbe9b 15.8 landed
- d97f2ee50e49 16.4 landed
- 935fe79ea1fb 17.0 landed
- 5c571a34d0e9 18.0 landed
-
Fix some anomalies with NO SCROLL cursors.
- d844cd75a676 14.0 cited