Keep rs_startblock the same during heap_rescan, so that a rescan of a SeqScan
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Jun 2009 18:54:16 +0000 (18:54 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Jun 2009 18:54:16 +0000 (18:54 +0000)
commit51ec830b663b4b8466bbc4bdf2511cd7dc3de35b
tree03cc15a522348b60c0db1ce3bfa02efa1006d686
parente66b2519e2b6fbd82b6eb4f9ebf2aad30a4c5a22
Keep rs_startblock the same during heap_rescan, so that a rescan of a SeqScan
node starts from the same place as the first scan did.  This avoids surprising
behavior of scrollable and WITH HOLD cursors, as seen in Mark Kirkwood's bug
report of yesterday.

It's not entirely clear whether a rescan should be forced to drop out of the
syncscan mode, but for the moment I left the code behaving the same on that
point.  Any change there would only be a performance and not a correctness
issue, anyway.

Back-patch to 8.3, since the unstable behavior was created by the syncscan
patch.
src/backend/access/heap/heapam.c