1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2004-08-01 17:32:22 +00:00
parent 9d9cdf82a4
commit efcaf1e868
23 changed files with 1103 additions and 330 deletions

View File

@ -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
* ----------------------------------------------------------------