Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
lockdefs.h60 linesDownload Raw Back to storage
1/*-------------------------------------------------------------------------2 *3 * lockdefs.h4 *	   Frontend exposed parts of postgres' low level lock mechanism5 *6 * The split between lockdefs.h and lock.h is not very principled. This file7 * contains definition that have to (indirectly) be available when included by8 * FRONTEND code.9 *10 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group11 * Portions Copyright (c) 1994, Regents of the University of California12 *13 * src/include/storage/lockdefs.h14 *15 *-------------------------------------------------------------------------16 */17#ifndef LOCKDEFS_H_18#define LOCKDEFS_H_19 20/*21 * LOCKMODE is an integer (1..N) indicating a lock type.  LOCKMASK is a bit22 * mask indicating a set of held or requested lock types (the bit 1<<mode23 * corresponds to a particular lock mode).24 */25typedef int LOCKMASK;26typedef int LOCKMODE;27 28/*29 * These are the valid values of type LOCKMODE for all the standard lock30 * methods (both DEFAULT and USER).31 */32 33/* NoLock is not a lock mode, but a flag value meaning "don't get a lock" */34#define NoLock					035 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, CREATE40									 * INDEX CONCURRENTLY */41#define ShareLock				5	/* CREATE INDEX (WITHOUT CONCURRENTLY) */42#define ShareRowExclusiveLock	6	/* like EXCLUSIVE MODE, but allows ROW43									 * 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 */47 48#define MaxLockMode				8	/* highest standard lock mode */49 50 51/* WAL representation of an AccessExclusiveLock on a table */52typedef struct xl_standby_lock53{54	TransactionId xid;			/* xid of holder of AccessExclusiveLock */55	Oid			dbOid;			/* DB containing table */56	Oid			relOid;			/* OID of table */57} xl_standby_lock;58 59#endif							/* LOCKDEFS_H_ */60 
codekingpro/portable-devtools · Team Ai