diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index dc303995e5..fc419fd8e6 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -209,8 +209,6 @@ index_beginscan(Relation heapRelation, { IndexScanDesc scan; - Assert(snapshot != InvalidSnapshot); - scan = index_beginscan_internal(indexRelation, nkeys, norderbys, snapshot, NULL, false); /* @@ -239,8 +237,6 @@ index_beginscan_bitmap(Relation indexRelation, { IndexScanDesc scan; - Assert(snapshot != InvalidSnapshot); - scan = index_beginscan_internal(indexRelation, nkeys, 0, snapshot, NULL, false); /* @@ -265,6 +261,8 @@ index_beginscan_internal(Relation indexRelation, RELATION_CHECKS; CHECK_REL_PROCEDURE(ambeginscan); + Assert(snapshot != InvalidSnapshot); + if (!(indexRelation->rd_indam->ampredlocks)) PredicateLockRelation(indexRelation, snapshot);