diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c index 16802b8..f91f717 100644 --- a/src/backend/executor/nodeTidscan.c +++ b/src/backend/executor/nodeTidscan.c @@ -143,7 +143,7 @@ TidListEval(TidScanState *tidstate) */ if (tidstate->ss.ss_currentScanDesc == NULL) tidstate->ss.ss_currentScanDesc = - table_beginscan(tidstate->ss.ss_currentRelation, + table_beginscan_tid(tidstate->ss.ss_currentRelation, tidstate->ss.ps.state->es_snapshot, 0, NULL); scan = tidstate->ss.ss_currentScanDesc; diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h index 696451f..de2de9a 100644 --- a/src/include/access/tableam.h +++ b/src/include/access/tableam.h @@ -830,6 +830,21 @@ table_beginscan_sampling(Relation rel, Snapshot snapshot, } /* + * table_beginscan_tid is an alternative entry point for setting up a + * TableScanDesc for a Tid scan. Although that scan technology is + * really quite unlike a standard seqscan, there is just enough commonality to + * make it worth using the same data structure. + */ +static inline TableScanDesc +table_beginscan_tid(Relation rel, Snapshot snapshot, + int nkeys, struct ScanKeyData *key) +{ + uint32 flags = SO_ALLOW_STRAT | SO_ALLOW_SYNC | SO_ALLOW_PAGEMODE; + + return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags); +} + +/* * table_beginscan_analyze is an alternative entry point for setting up a * TableScanDesc for an ANALYZE scan. As with bitmap scans, it's worth using * the same data structure although the behavior is rather different.