Unmark gen_random_uuid() function leakproof.
[pgsql.git] / src / include / storage / lockdefs.h
blob810b297edf95b2e7cfdf041694ed51ac97d1a91b
1 /*-------------------------------------------------------------------------
3 * lockdefs.h
4 * Frontend exposed parts of postgres' low level lock mechanism
6 * The split between lockdefs.h and lock.h is not very principled. This file
7 * contains definition that have to (indirectly) be available when included by
8 * FRONTEND code.
10 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
11 * Portions Copyright (c) 1994, Regents of the University of California
13 * src/include/storage/lockdefs.h
15 *-------------------------------------------------------------------------
17 #ifndef LOCKDEFS_H_
18 #define LOCKDEFS_H_
21 * LOCKMODE is an integer (1..N) indicating a lock type. LOCKMASK is a bit
22 * mask indicating a set of held or requested lock types (the bit 1<<mode
23 * corresponds to a particular lock mode).
25 typedef int LOCKMASK;
26 typedef int LOCKMODE;
29 * These are the valid values of type LOCKMODE for all the standard lock
30 * methods (both DEFAULT and USER).
33 /* NoLock is not a lock mode, but a flag value meaning "don't get a lock" */
34 #define NoLock 0
36 #define AccessShareLock 1 /* SELECT */
37 #define RowShareLock 2 /* SELECT FOR UPDATE/FOR SHARE */
38 #define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */
39 #define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL), ANALYZE, CREATE
40 * INDEX CONCURRENTLY */
41 #define ShareLock 5 /* CREATE INDEX (WITHOUT CONCURRENTLY) */
42 #define ShareRowExclusiveLock 6 /* like EXCLUSIVE MODE, but allows ROW
43 * SHARE */
44 #define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR UPDATE */
45 #define AccessExclusiveLock 8 /* ALTER TABLE, DROP TABLE, VACUUM FULL,
46 * and unqualified LOCK TABLE */
48 #define MaxLockMode 8 /* highest standard lock mode */
50 /* See README.tuplock section "Locking to write inplace-updated tables" */
51 #define InplaceUpdateTupleLock ExclusiveLock
53 /* WAL representation of an AccessExclusiveLock on a table */
54 typedef struct xl_standby_lock
56 TransactionId xid; /* xid of holder of AccessExclusiveLock */
57 Oid dbOid; /* DB containing table */
58 Oid relOid; /* OID of table */
59 } xl_standby_lock;
61 #endif /* LOCKDEFS_H_ */