Rearrange order of pre-commit operations: must close cursors before doing
ON COMMIT actions. Per bug report from Michael Guerin.
This commit is contained in:
parent
7d38e59448
commit
23f264d125
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.192 2004/10/16 18:57:22 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.193 2004/10/29 22:19:53 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1437,6 +1437,11 @@ CommitTransaction(void)
|
|||||||
TransStateAsString(s->state));
|
TransStateAsString(s->state));
|
||||||
Assert(s->parent == NULL);
|
Assert(s->parent == NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Do pre-commit processing (most of this stuff requires database
|
||||||
|
* access, and in fact could still cause an error...)
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tell the trigger manager that this transaction is about to be
|
* Tell the trigger manager that this transaction is about to be
|
||||||
* committed. He'll invoke all trigger deferred until XACT before we
|
* committed. He'll invoke all trigger deferred until XACT before we
|
||||||
@ -1444,28 +1449,15 @@ CommitTransaction(void)
|
|||||||
*/
|
*/
|
||||||
AfterTriggerEndXact();
|
AfterTriggerEndXact();
|
||||||
|
|
||||||
|
/* Close open cursors */
|
||||||
|
AtCommit_Portals();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Similarly, let ON COMMIT management do its thing before we start to
|
* Let ON COMMIT management do its thing (must happen after closing
|
||||||
* commit.
|
* cursors, to avoid dangling-reference problems)
|
||||||
*/
|
*/
|
||||||
PreCommit_on_commit_actions();
|
PreCommit_on_commit_actions();
|
||||||
|
|
||||||
/* Prevent cancel/die interrupt while cleaning up */
|
|
||||||
HOLD_INTERRUPTS();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* set the current transaction state information appropriately during
|
|
||||||
* the abort processing
|
|
||||||
*/
|
|
||||||
s->state = TRANS_COMMIT;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Do pre-commit processing (most of this stuff requires database
|
|
||||||
* access, and in fact could still cause an error...)
|
|
||||||
*/
|
|
||||||
|
|
||||||
AtCommit_Portals();
|
|
||||||
|
|
||||||
/* close large objects before lower-level cleanup */
|
/* close large objects before lower-level cleanup */
|
||||||
AtEOXact_LargeObject(true);
|
AtEOXact_LargeObject(true);
|
||||||
|
|
||||||
@ -1476,6 +1468,15 @@ CommitTransaction(void)
|
|||||||
/* This should be the last step before commit */
|
/* This should be the last step before commit */
|
||||||
AtEOXact_UpdatePasswordFile(true);
|
AtEOXact_UpdatePasswordFile(true);
|
||||||
|
|
||||||
|
/* Prevent cancel/die interrupt while cleaning up */
|
||||||
|
HOLD_INTERRUPTS();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set the current transaction state information appropriately during
|
||||||
|
* the abort processing
|
||||||
|
*/
|
||||||
|
s->state = TRANS_COMMIT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Here is where we really truly commit.
|
* Here is where we really truly commit.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user