1996-08-28 01:59:28 +00:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-13 23:22:53 +00:00
|
|
|
* lmgr.h
|
1997-09-07 05:04:48 +00:00
|
|
|
* POSTGRES lock manager definitions.
|
1996-08-28 01:59:28 +00:00
|
|
|
*
|
|
|
|
*
|
2000-01-26 05:58:53 +00:00
|
|
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 01:59:28 +00:00
|
|
|
*
|
2000-11-28 23:27:57 +00:00
|
|
|
* $Id: lmgr.h,v 1.26 2000/11/28 23:27:57 tgl Exp $
|
1996-08-28 01:59:28 +00:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 05:04:48 +00:00
|
|
|
#ifndef LMGR_H
|
1996-08-28 01:59:28 +00:00
|
|
|
#define LMGR_H
|
|
|
|
|
1999-07-15 23:04:24 +00:00
|
|
|
#include "storage/lock.h"
|
|
|
|
#include "utils/rel.h"
|
1996-08-28 01:59:28 +00:00
|
|
|
|
1999-09-18 19:08:25 +00:00
|
|
|
/* These are the valid values of type LOCKMODE: */
|
|
|
|
|
|
|
|
/* NoLock is not a lock mode, but a flag value meaning "don't get a lock" */
|
|
|
|
#define NoLock 0
|
|
|
|
|
1998-12-15 12:47:01 +00:00
|
|
|
#define AccessShareLock 1 /* SELECT */
|
|
|
|
#define RowShareLock 2 /* SELECT FOR UPDATE */
|
|
|
|
#define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */
|
|
|
|
#define ShareLock 4
|
|
|
|
#define ShareRowExclusiveLock 5
|
|
|
|
#define ExclusiveLock 6
|
|
|
|
#define AccessExclusiveLock 7
|
|
|
|
|
|
|
|
extern LOCKMETHOD LockTableId;
|
|
|
|
|
|
|
|
|
|
|
|
extern LOCKMETHOD InitLockTable(void);
|
1997-09-08 02:41:22 +00:00
|
|
|
extern void RelationInitLockInfo(Relation relation);
|
1996-08-28 01:59:28 +00:00
|
|
|
|
1998-12-15 12:47:01 +00:00
|
|
|
extern void LockRelation(Relation relation, LOCKMODE lockmode);
|
|
|
|
extern void UnlockRelation(Relation relation, LOCKMODE lockmode);
|
1996-08-28 01:59:28 +00:00
|
|
|
|
1998-12-15 12:47:01 +00:00
|
|
|
/* this is for indices */
|
|
|
|
extern void LockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
|
|
|
|
extern void UnlockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode);
|
1996-08-28 01:59:28 +00:00
|
|
|
|
1998-12-15 12:47:01 +00:00
|
|
|
/* and this is for transactions */
|
|
|
|
extern void XactLockTableInsert(TransactionId xid);
|
|
|
|
extern void XactLockTableWait(TransactionId xid);
|
1996-08-28 01:59:28 +00:00
|
|
|
|
1998-09-01 04:40:42 +00:00
|
|
|
#endif /* LMGR_H */
|