#include "postgres.h"
-#include "access/heapam.h"
#include "access/nbtree.h"
#include "access/nbtxlog.h"
+#include "access/tableam.h"
#include "access/transam.h"
#include "access/xloginsert.h"
#include "miscadmin.h"
* that satisfies SnapshotDirty. This is necessary because we
* have just a single index entry for the entire chain.
*/
- else if (heap_hot_search(&htid, heapRel, &SnapshotDirty,
- &all_dead))
+ else if (table_fetch_follow_check(heapRel, &htid, &SnapshotDirty,
+ &all_dead))
{
TransactionId xwait;
* entry.
*/
htid = itup->t_tid;
- if (heap_hot_search(&htid, heapRel, SnapshotSelf, NULL))
+ if (table_fetch_follow_check(heapRel, &htid, SnapshotSelf, NULL))
{
/* Normal case --- it's still live */
}
#include "postgres.h"
-#include "access/heapam.h"
#include "access/nbtree.h"
#include "access/parallel.h"
#include "access/relscan.h"
+#include "access/table.h"
#include "access/tableam.h"
#include "access/xact.h"
#include "access/xlog.h"
true, true, true, false, false, true);
}
+bool
+table_fetch_follow_check(Relation rel,
+ ItemPointer tid,
+ Snapshot snapshot,
+ bool *all_dead)
+{
+ IndexFetchTableData *scan = table_begin_index_fetch_table(rel);
+ TupleTableSlot *slot = table_gimmegimmeslot(rel, NULL);
+ bool call_again = false;
+ bool found;
+
+ found = table_fetch_follow(scan, tid, snapshot, slot, &call_again, all_dead);
+
+ table_end_index_fetch_table(scan);
+ ExecDropSingleTupleTableSlot(slot);
+
+ return found;
+}
+
/*
* simple_table_update - replace a tuple
*
all_dead);
}
+extern bool table_fetch_follow_check(Relation rel,
+ ItemPointer tid,
+ Snapshot snapshot,
+ bool *all_dead);
+
/*
* Return true iff tuple in slot satisfies the snapshot.
*