mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Invent ResourceOwner mechanism as per my recent proposal, and use it to
keep track of portal-related resources separately from transaction-related resources. This allows cursors to work in a somewhat sane fashion with nested transactions. For now, cursor behavior is non-subtransactional, that is a cursor's state does not roll back if you abort a subtransaction that fetched from the cursor. We might want to change that later.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.78 2004/07/01 00:51:43 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.79 2004/07/17 03:31:26 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -26,14 +26,6 @@ typedef struct PROC_QUEUE
|
||||
int size; /* number of entries in list */
|
||||
} PROC_QUEUE;
|
||||
|
||||
/* Release options for LockReleaseAll */
|
||||
typedef enum
|
||||
{
|
||||
ReleaseAll, /* All my locks */
|
||||
ReleaseAllExceptSession, /* All except session locks (Xid = 0) */
|
||||
ReleaseGivenXids /* Only locks with Xids in given array */
|
||||
} LockReleaseWhich;
|
||||
|
||||
/* struct PGPROC is declared in storage/proc.h, but must forward-reference it */
|
||||
typedef struct PGPROC PGPROC;
|
||||
|
||||
@@ -248,7 +240,7 @@ extern bool LockAcquire(LOCKMETHODID lockmethodid, LOCKTAG *locktag,
|
||||
extern bool LockRelease(LOCKMETHODID lockmethodid, LOCKTAG *locktag,
|
||||
TransactionId xid, LOCKMODE lockmode);
|
||||
extern bool LockReleaseAll(LOCKMETHODID lockmethodid, PGPROC *proc,
|
||||
LockReleaseWhich which, int nxids, TransactionId *xids);
|
||||
bool allxids);
|
||||
extern int LockCheckConflicts(LockMethod lockMethodTable,
|
||||
LOCKMODE lockmode,
|
||||
LOCK *lock, PROCLOCK *proclock, PGPROC *proc,
|
||||
|
||||
Reference in New Issue
Block a user