commit fea0ea9bceb698dbe88bee42d5fc5f3332a658dd
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date:   Wed Sep 26 15:29:43 2018 +0300

    Remove some snapshot functions from TableAmRoutine
    
    snapshot_satisfiesUpdate was unused.  snapshot_satisfiesVacuum was used only
    inside heap_copy_for_cluster, so it was replaced to direct
    heapam_satisfies_vacuum() call.

diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c
index c3960dc91fd..28c475e7bdc 100644
--- a/src/backend/access/heap/heapam_handler.c
+++ b/src/backend/access/heap/heapam_handler.c
@@ -483,21 +483,6 @@ heapam_satisfies(TupleTableSlot *slot, Snapshot snapshot)
 	return res;
 }
 
-static HTSU_Result
-heapam_satisfies_update(TupleTableSlot *slot, CommandId curcid)
-{
-	BufferHeapTupleTableSlot *bslot = (BufferHeapTupleTableSlot *) slot;
-	HTSU_Result res;
-
-	LockBuffer(bslot->buffer, BUFFER_LOCK_SHARE);
-	res = HeapTupleSatisfiesUpdate(bslot->base.tuple,
-								   curcid,
-								   bslot->buffer);
-	LockBuffer(bslot->buffer, BUFFER_LOCK_UNLOCK);
-
-	return res;
-}
-
 static HTSV_Result
 heapam_satisfies_vacuum(TupleTableSlot *slot, TransactionId OldestXmin)
 {
@@ -2003,7 +1988,7 @@ heap_copy_for_cluster(Relation OldHeap, Relation NewHeap, Relation OldIndex,
 				break;
 		}
 
-		switch (OldHeap->rd_tableamroutine->snapshot_satisfiesVacuum(slot, OldestXmin))
+		switch (heapam_satisfies_vacuum(slot, OldestXmin))
 		{
 			case HEAPTUPLE_DEAD:
 				/* Definitely dead */
@@ -2122,8 +2107,6 @@ static const TableAmRoutine heapam_methods = {
 	.slot_callbacks = heapam_slot_callbacks,
 
 	.snapshot_satisfies = heapam_satisfies,
-	.snapshot_satisfiesUpdate = heapam_satisfies_update,
-	.snapshot_satisfiesVacuum = heapam_satisfies_vacuum,
 
 	.scan_begin = heap_beginscan,
 	.scansetlimits = heap_setscanlimits,
diff --git a/src/backend/access/zheap/zheapam_handler.c b/src/backend/access/zheap/zheapam_handler.c
index bec9b16f7d6..e707baa1b5d 100644
--- a/src/backend/access/zheap/zheapam_handler.c
+++ b/src/backend/access/zheap/zheapam_handler.c
@@ -486,40 +486,6 @@ zheapam_satisfies(TupleTableSlot *slot, Snapshot snapshot)
 #endif
 }
 
-static HTSU_Result
-zheapam_satisfies_update(TupleTableSlot *slot, CommandId curcid)
-{
-	elog(ERROR, "would need to track buffer or refetch");
-#if ZBORKED
-	BufferHeapTupleTableSlot *zslot = (BufferHeapTupleTableSlot *) slot;
-	HTSU_Result res;
-
-
-	LockBuffer(bslot->buffer, BUFFER_LOCK_SHARE);
-	res = HeapTupleSatisfiesUpdate(bslot->base.tuple,
-								   curcid,
-								   bslot->buffer);
-	LockBuffer(bslot->buffer, BUFFER_LOCK_UNLOCK);
-
-	return res;
-#endif
-}
-
-static HTSV_Result
-zheapam_satisfies_vacuum(TupleTableSlot *slot, TransactionId OldestXmin)
-{
-	BufferHeapTupleTableSlot *bslot = (BufferHeapTupleTableSlot *) slot;
-	HTSV_Result res;
-
-	LockBuffer(bslot->buffer, BUFFER_LOCK_SHARE);
-	res = HeapTupleSatisfiesVacuum(bslot->base.tuple,
-								   OldestXmin,
-								   bslot->buffer);
-	LockBuffer(bslot->buffer, BUFFER_LOCK_UNLOCK);
-
-	return res;
-}
-
 static IndexFetchTableData*
 zheapam_begin_index_fetch(Relation rel)
 {
@@ -1621,8 +1587,6 @@ static const TableAmRoutine zheapam_methods = {
 	.slot_callbacks = zheapam_slot_callbacks,
 
 	.snapshot_satisfies = zheapam_satisfies,
-	.snapshot_satisfiesUpdate = zheapam_satisfies_update,
-	.snapshot_satisfiesVacuum = zheapam_satisfies_vacuum,
 
 	.scan_begin = zheap_beginscan,
 	.scansetlimits = zheap_setscanlimits,
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index 7fe6ff6c221..fb37a739918 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -55,8 +55,6 @@ extern bool synchronize_seqscans;
  * Storage routine function hooks
  */
 typedef bool (*SnapshotSatisfies_function) (TupleTableSlot *slot, Snapshot snapshot);
-typedef HTSU_Result (*SnapshotSatisfiesUpdate_function) (TupleTableSlot *slot, CommandId curcid);
-typedef HTSV_Result (*SnapshotSatisfiesVacuum_function) (TupleTableSlot *slot, TransactionId OldestXmin);
 
 typedef Oid (*TupleInsert_function) (Relation rel, TupleTableSlot *slot, CommandId cid,
 									 int options, BulkInsertState bistate);
@@ -205,8 +203,6 @@ typedef struct TableAmRoutine
 	SlotCallbacks_function slot_callbacks;
 
 	SnapshotSatisfies_function snapshot_satisfies;
-	SnapshotSatisfiesUpdate_function snapshot_satisfiesUpdate;
-	SnapshotSatisfiesVacuum_function snapshot_satisfiesVacuum;
 
 	/* Operations on physical tuples */
 	TupleInsert_function tuple_insert;
