diff options
Diffstat (limited to 'src/include/access/heapam.h')
-rw-r--r-- | src/include/access/heapam.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index c737b3ff289..af9e506d2b8 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -30,12 +30,23 @@ typedef struct BulkInsertStateData *BulkInsertState; -typedef enum +/* + * Possible lock modes for a tuple. + */ +typedef enum LockTupleMode { - LockTupleShared, + /* SELECT FOR KEY SHARE */ + LockTupleKeyShare, + /* SELECT FOR SHARE */ + LockTupleShare, + /* SELECT FOR NO KEY UPDATE, and UPDATEs that don't modify key columns */ + LockTupleNoKeyExclusive, + /* SELECT FOR UPDATE, UPDATEs that modify key columns, and DELETE */ LockTupleExclusive } LockTupleMode; +#define MaxLockTupleMode LockTupleExclusive + /* * When heap_update, heap_delete, or heap_lock_tuple fail because the target * tuple is already outdated, they fill in this struct to provide information @@ -129,14 +140,16 @@ extern HTSU_Result heap_delete(Relation relation, ItemPointer tid, extern HTSU_Result heap_update(Relation relation, ItemPointer otid, HeapTuple newtup, CommandId cid, Snapshot crosscheck, bool wait, - HeapUpdateFailureData *hufd); + HeapUpdateFailureData *hufd, LockTupleMode *lockmode); extern HTSU_Result heap_lock_tuple(Relation relation, HeapTuple tuple, CommandId cid, LockTupleMode mode, bool nowait, + bool follow_update, Buffer *buffer, HeapUpdateFailureData *hufd); extern void heap_inplace_update(Relation relation, HeapTuple tuple); -extern bool heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid); +extern bool heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid, + TransactionId cutoff_multi); extern bool heap_tuple_needs_freeze(HeapTupleHeader tuple, TransactionId cutoff_xid, - Buffer buf); + MultiXactId cutoff_multi, Buffer buf); extern Oid simple_heap_insert(Relation relation, HeapTuple tup); extern void simple_heap_delete(Relation relation, ItemPointer tid); |