mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
tableam: Add table_get_latest_tid, to wrap heap_get_latest_tid.
This primarily is to allow WHERE CURRENT OF to continue to work as it currently does. It's not clear to me that these semantics make sense for every AM, but it works for the in-core heap, and the out of core zheap. We can refine it further at a later point if necessary. Author: Andres Freund Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
This commit is contained in:
@@ -283,6 +283,14 @@ typedef struct TableAmRoutine
|
||||
Snapshot snapshot,
|
||||
TupleTableSlot *slot);
|
||||
|
||||
/*
|
||||
* Return the latest version of the tuple at `tid`, by updating `tid` to
|
||||
* point at the newest version.
|
||||
*/
|
||||
void (*tuple_get_latest_tid) (Relation rel,
|
||||
Snapshot snapshot,
|
||||
ItemPointer tid);
|
||||
|
||||
/*
|
||||
* Does the tuple in `slot` satisfy `snapshot`? The slot needs to be of
|
||||
* the appropriate type for the AM.
|
||||
@@ -656,6 +664,16 @@ table_fetch_row_version(Relation rel,
|
||||
return rel->rd_tableam->tuple_fetch_row_version(rel, tid, snapshot, slot);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the latest version of the tuple at `tid`, by updating `tid` to
|
||||
* point at the newest version.
|
||||
*/
|
||||
static inline void
|
||||
table_get_latest_tid(Relation rel, Snapshot snapshot, ItemPointer tid)
|
||||
{
|
||||
rel->rd_tableam->tuple_get_latest_tid(rel, snapshot, tid);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true iff tuple in slot satisfies the snapshot.
|
||||
*
|
||||
|
Reference in New Issue
Block a user