mirror of https://github.com/postgres/postgres
Given these routines are heap specific, and that there will be more generic visibility support in via table AM, it makes sense to move the prototypes to heapam.h (routines like HeapTupleSatisfiesVacuum will not be exposed in a generic fashion, because they are too storage specific). Similarly, the code in tqual.c is specific to heap, so moving it into access/heap/ makes sense. Author: Andres Freund Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.depull/37/head
parent
b7eda3e0e3
commit
c91560defc
@ -1,56 +0,0 @@ |
|||||||
/*-------------------------------------------------------------------------
|
|
||||||
* |
|
||||||
* tqual.h |
|
||||||
* POSTGRES "time qualification" definitions, ie, tuple visibility rules. |
|
||||||
* |
|
||||||
* Should be moved/renamed... - vadim 07/28/98 |
|
||||||
* |
|
||||||
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group |
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California |
|
||||||
* |
|
||||||
* src/include/utils/tqual.h |
|
||||||
* |
|
||||||
*------------------------------------------------------------------------- |
|
||||||
*/ |
|
||||||
#ifndef TQUAL_H |
|
||||||
#define TQUAL_H |
|
||||||
|
|
||||||
#include "utils/snapshot.h" |
|
||||||
|
|
||||||
extern bool HeapTupleSatisfiesVisibility(HeapTuple stup, Snapshot snapshot, |
|
||||||
Buffer buffer); |
|
||||||
|
|
||||||
/* Result codes for HeapTupleSatisfiesVacuum */ |
|
||||||
typedef enum |
|
||||||
{ |
|
||||||
HEAPTUPLE_DEAD, /* tuple is dead and deletable */ |
|
||||||
HEAPTUPLE_LIVE, /* tuple is live (committed, no deleter) */ |
|
||||||
HEAPTUPLE_RECENTLY_DEAD, /* tuple is dead, but not deletable yet */ |
|
||||||
HEAPTUPLE_INSERT_IN_PROGRESS, /* inserting xact is still in progress */ |
|
||||||
HEAPTUPLE_DELETE_IN_PROGRESS /* deleting xact is still in progress */ |
|
||||||
} HTSV_Result; |
|
||||||
|
|
||||||
/* Special "satisfies" routines with different APIs */ |
|
||||||
extern HTSU_Result HeapTupleSatisfiesUpdate(HeapTuple htup, |
|
||||||
CommandId curcid, Buffer buffer); |
|
||||||
extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, |
|
||||||
TransactionId OldestXmin, Buffer buffer); |
|
||||||
extern bool HeapTupleIsSurelyDead(HeapTuple htup, |
|
||||||
TransactionId OldestXmin); |
|
||||||
|
|
||||||
extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer, |
|
||||||
uint16 infomask, TransactionId xid); |
|
||||||
extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple); |
|
||||||
|
|
||||||
/*
|
|
||||||
* To avoid leaking too much knowledge about reorderbuffer implementation |
|
||||||
* details this is implemented in reorderbuffer.c not tqual.c. |
|
||||||
*/ |
|
||||||
struct HTAB; |
|
||||||
extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data, |
|
||||||
Snapshot snapshot, |
|
||||||
HeapTuple htup, |
|
||||||
Buffer buffer, |
|
||||||
CommandId *cmin, CommandId *cmax); |
|
||||||
|
|
||||||
#endif /* TQUAL_H */ |
|
Loading…
Reference in new issue