Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TQUAL_H
00016 #define TQUAL_H
00017
00018 #include "utils/snapshot.h"
00019
00020
00021
00022 extern PGDLLIMPORT SnapshotData SnapshotNowData;
00023 extern PGDLLIMPORT SnapshotData SnapshotSelfData;
00024 extern PGDLLIMPORT SnapshotData SnapshotAnyData;
00025 extern PGDLLIMPORT SnapshotData SnapshotToastData;
00026
00027 #define SnapshotNow (&SnapshotNowData)
00028 #define SnapshotSelf (&SnapshotSelfData)
00029 #define SnapshotAny (&SnapshotAnyData)
00030 #define SnapshotToast (&SnapshotToastData)
00031
00032
00033
00034
00035
00036
00037 #define InitDirtySnapshot(snapshotdata) \
00038 ((snapshotdata).satisfies = HeapTupleSatisfiesDirty)
00039
00040
00041 #define IsMVCCSnapshot(snapshot) \
00042 ((snapshot)->satisfies == HeapTupleSatisfiesMVCC)
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #define HeapTupleSatisfiesVisibility(tuple, snapshot, buffer) \
00055 ((*(snapshot)->satisfies) ((tuple)->t_data, snapshot, buffer))
00056
00057
00058 typedef enum
00059 {
00060 HEAPTUPLE_DEAD,
00061 HEAPTUPLE_LIVE,
00062 HEAPTUPLE_RECENTLY_DEAD,
00063 HEAPTUPLE_INSERT_IN_PROGRESS,
00064 HEAPTUPLE_DELETE_IN_PROGRESS
00065 } HTSV_Result;
00066
00067
00068 extern bool HeapTupleSatisfiesMVCC(HeapTupleHeader tuple,
00069 Snapshot snapshot, Buffer buffer);
00070 extern bool HeapTupleSatisfiesNow(HeapTupleHeader tuple,
00071 Snapshot snapshot, Buffer buffer);
00072 extern bool HeapTupleSatisfiesSelf(HeapTupleHeader tuple,
00073 Snapshot snapshot, Buffer buffer);
00074 extern bool HeapTupleSatisfiesAny(HeapTupleHeader tuple,
00075 Snapshot snapshot, Buffer buffer);
00076 extern bool HeapTupleSatisfiesToast(HeapTupleHeader tuple,
00077 Snapshot snapshot, Buffer buffer);
00078 extern bool HeapTupleSatisfiesDirty(HeapTupleHeader tuple,
00079 Snapshot snapshot, Buffer buffer);
00080
00081
00082 extern HTSU_Result HeapTupleSatisfiesUpdate(HeapTupleHeader tuple,
00083 CommandId curcid, Buffer buffer);
00084 extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTupleHeader tuple,
00085 TransactionId OldestXmin, Buffer buffer);
00086 extern bool HeapTupleIsSurelyDead(HeapTupleHeader tuple,
00087 TransactionId OldestXmin);
00088
00089 extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
00090 uint16 infomask, TransactionId xid);
00091 extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
00092
00093 #endif