2323 */
2424#include "postgres.h"
2525
26- #include "access/heapam.h"
2726#include "access/htup_details.h"
2827#include "access/nbtree.h"
28+ #include "access/table.h"
2929#include "access/tableam.h"
3030#include "access/transam.h"
3131#include "access/xact.h"
@@ -142,7 +142,7 @@ static void bt_tuple_present_callback(Relation index, HeapTuple htup,
142142 Datum * values , bool * isnull ,
143143 bool tupleIsAlive , void * checkstate );
144144static IndexTuple bt_normalize_tuple (BtreeCheckState * state ,
145- IndexTuple itup );
145+ IndexTuple itup );
146146static bool bt_rootdescend (BtreeCheckState * state , IndexTuple itup );
147147static inline bool offset_is_negative_infinity (BTPageOpaque opaque ,
148148 OffsetNumber offset );
@@ -387,10 +387,10 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
387387
388388 /*
389389 * Register our own snapshot in !readonly case, rather than asking
390- * IndexBuildHeapScan () to do this for us later. This needs to happen
391- * before index fingerprinting begins, so we can later be certain that
392- * index fingerprinting should have reached all tuples returned by
393- * IndexBuildHeapScan ().
390+ * table_index_build_scan () to do this for us later. This needs to
391+ * happen before index fingerprinting begins, so we can later be
392+ * certain that index fingerprinting should have reached all tuples
393+ * returned by table_index_build_scan ().
394394 *
395395 * In readonly case, we also check for problems with missing
396396 * downlinks. A second Bloom filter is used for this.
@@ -525,18 +525,19 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
525525 }
526526
527527 /*
528- * Create our own scan for IndexBuildHeapScan(), rather than getting
529- * it to do so for us. This is required so that we can actually use
530- * the MVCC snapshot registered earlier in !readonly case.
528+ * Create our own scan for table_index_build_scan(), rather than
529+ * getting it to do so for us. This is required so that we can
530+ * actually use the MVCC snapshot registered earlier in !readonly
531+ * case.
531532 *
532- * Note that IndexBuildHeapScan () calls heap_endscan() for us.
533+ * Note that table_index_build_scan () calls heap_endscan() for us.
533534 */
534- scan = table_beginscan_strat (state -> heaprel , /* relation */
535+ scan = table_beginscan_strat (state -> heaprel , /* relation */
535536 snapshot , /* snapshot */
536- 0 , /* number of keys */
537+ 0 , /* number of keys */
537538 NULL , /* scan key */
538539 true, /* buffer access strategy OK */
539- true); /* syncscan OK? */
540+ true); /* syncscan OK? */
540541
541542 /*
542543 * Scan will behave as the first scan of a CREATE INDEX CONCURRENTLY
@@ -565,8 +566,8 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
565566 RelationGetRelationName (state -> rel ),
566567 RelationGetRelationName (state -> heaprel ));
567568
568- IndexBuildHeapScan (state -> heaprel , state -> rel , indexinfo , true,
569- bt_tuple_present_callback , (void * ) state , scan );
569+ table_index_build_scan (state -> heaprel , state -> rel , indexinfo , true,
570+ bt_tuple_present_callback , (void * ) state , scan );
570571
571572 ereport (DEBUG1 ,
572573 (errmsg_internal ("finished verifying presence of " INT64_FORMAT " tuples from table \"%s\" with bitset %.2f%% set" ,
@@ -814,7 +815,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
814815 * (Limited to heapallindexed readonly callers.)
815816 *
816817 * This is also where heapallindexed callers use their Bloom filter to
817- * fingerprint IndexTuples for later IndexBuildHeapScan () verification.
818+ * fingerprint IndexTuples for later table_index_build_scan () verification.
818819 *
819820 * Note: Memory allocated in this routine is expected to be released by caller
820821 * resetting state->targetcontext.
@@ -1776,7 +1777,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
17761777}
17771778
17781779/*
1779- * Per-tuple callback from IndexBuildHeapScan , used to determine if index has
1780+ * Per-tuple callback from table_index_build_scan , used to determine if index has
17801781 * all the entries that definitely should have been observed in leaf pages of
17811782 * the target index (that is, all IndexTuples that were fingerprinted by our
17821783 * Bloom filter). All heapallindexed checks occur here.
@@ -1801,7 +1802,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
18011802 * verification, just in case it's a cross-page invariant issue, though that
18021803 * isn't particularly likely.
18031804 *
1804- * IndexBuildHeapScan () expects to be able to find the root tuple when a
1805+ * table_index_build_scan () expects to be able to find the root tuple when a
18051806 * heap-only tuple (the live tuple at the end of some HOT chain) needs to be
18061807 * indexed, in order to replace the actual tuple's TID with the root tuple's
18071808 * TID (which is what we're actually passed back here). The index build heap
@@ -1817,7 +1818,7 @@ bt_downlink_missing_check(BtreeCheckState *state)
18171818 * setting will probably also leave the index in a corrupt state before too
18181819 * long, the problem is nonetheless that there is heap corruption.)
18191820 *
1820- * Heap-only tuple handling within IndexBuildHeapScan () works in a way that
1821+ * Heap-only tuple handling within table_index_build_scan () works in a way that
18211822 * helps us to detect index tuples that contain the wrong values (values that
18221823 * don't match the latest tuple in the HOT chain). This can happen when there
18231824 * is no superseding index tuple due to a faulty assessment of HOT safety,
0 commit comments