diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-01 17:32:22 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-01 17:32:22 +0000 |
| commit | efcaf1e868d8399d932e68b8b248bcbd089b2d6b (patch) | |
| tree | c6235945f73faab427498dd8662efab5cf2fe5fd /src/include/access/xact.h | |
| parent | 9d9cdf82a404f3e2a2d82cefc2c35ded55bb3b2e (diff) | |
| download | postgresql-efcaf1e868d8399d932e68b8b248bcbd089b2d6b.tar.gz | |
Some mop-up work for savepoints (nested transactions). Store a small
number of active subtransaction XIDs in each backend's PGPROC entry,
and use this to avoid expensive probes into pg_subtrans during
TransactionIdIsInProgress. Extend EOXactCallback API to allow add-on
modules to get control at subxact start/end. (This is deliberately
not compatible with the former API, since any uses of that API probably
need manual review anyway.) Add basic reference documentation for
SAVEPOINT and related commands. Minor other cleanups to check off some
of the open issues for subtransactions.
Alvaro Herrera and Tom Lane.
Diffstat (limited to 'src/include/access/xact.h')
| -rw-r--r-- | src/include/access/xact.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 532dcf51b0..16b7de333a 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -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/access/xact.h,v 1.68 2004/07/31 07:39:19 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/xact.h,v 1.69 2004/08/01 17:32:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -42,9 +42,18 @@ extern bool DefaultXactReadOnly; extern bool XactReadOnly; /* - * end-of-transaction cleanup callbacks for dynamically loaded modules + * start- and end-of-transaction callbacks for dynamically loaded modules */ -typedef void (*EOXactCallback) (bool isCommit, void *arg); +typedef enum +{ + XACT_EVENT_ABORT, + XACT_EVENT_COMMIT, + XACT_EVENT_START_SUB, + XACT_EVENT_ABORT_SUB, + XACT_EVENT_COMMIT_SUB +} XactEvent; + +typedef void (*XactCallback) (XactEvent event, TransactionId parentXid, void *arg); /* ---------------- @@ -118,8 +127,8 @@ extern void AbortOutOfAnyTransaction(void); extern void PreventTransactionChain(void *stmtNode, const char *stmtType); extern void RequireTransactionChain(void *stmtNode, const char *stmtType); extern bool IsInTransactionChain(void *stmtNode); -extern void RegisterEOXactCallback(EOXactCallback callback, void *arg); -extern void UnregisterEOXactCallback(EOXactCallback callback, void *arg); +extern void RegisterXactCallback(XactCallback callback, void *arg); +extern void UnregisterXactCallback(XactCallback callback, void *arg); extern void RecordTransactionCommit(void); |
