Keep rs_startblock the same during heap_rescan, so that a rescan of a SeqScan
commit6a4b0a82fa2f151eca9c45613e697298e131b41b
authortgl <tgl>
Wed, 10 Jun 2009 18:54:16 +0000 (10 18:54 +0000)
committertgl <tgl>
Wed, 10 Jun 2009 18:54:16 +0000 (10 18:54 +0000)
treef4dbf0e29dc18b2de709ebc493ab6773fb5957cd
parente4bc7fbf7b7c5b523ec88b9f64fd59c1ffd15c74
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