summaryrefslogtreecommitdiff
path: root/src/backend/utils/init
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-01 17:32:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-01 17:32:22 +0000
commitefcaf1e868d8399d932e68b8b248bcbd089b2d6b (patch)
treec6235945f73faab427498dd8662efab5cf2fe5fd /src/backend/utils/init
parent9d9cdf82a404f3e2a2d82cefc2c35ded55bb3b2e (diff)
downloadpostgresql-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/backend/utils/init')
-rw-r--r--src/backend/utils/init/miscinit.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index 2ae41c013c..e5e21e8719 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.129 2004/07/12 00:09:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.130 2004/08/01 17:32:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -115,19 +115,29 @@ ReindexIsProcessingIndex(Oid indexOid)
/*
* SetReindexProcessing
* Set flag that specified heap/index are being reindexed.
- * Pass InvalidOid to indicate that reindexing is not active.
*/
void
SetReindexProcessing(Oid heapOid, Oid indexOid)
{
- /* Args should be both, or neither, InvalidOid */
- Assert((heapOid == InvalidOid) == (indexOid == InvalidOid));
+ Assert(OidIsValid(heapOid) && OidIsValid(indexOid));
/* Reindexing is not re-entrant. */
- Assert(indexOid == InvalidOid || currentlyReindexedIndex == InvalidOid);
+ if (OidIsValid(currentlyReindexedIndex))
+ elog(ERROR, "cannot reindex while reindexing");
currentlyReindexedHeap = heapOid;
currentlyReindexedIndex = indexOid;
}
+/*
+ * ResetReindexProcessing
+ * Unset reindexing status.
+ */
+void
+ResetReindexProcessing(void)
+{
+ currentlyReindexedHeap = InvalidOid;
+ currentlyReindexedIndex = InvalidOid;
+}
+
/* ----------------------------------------------------------------
* database path / name support stuff
* ----------------------------------------------------------------