Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23f264d

Browse files
committed
Rearrange order of pre-commit operations: must close cursors before doing
ON COMMIT actions. Per bug report from Michael Guerin.
1 parent7d38e59 commit23f264d

File tree

1 file changed

+20
-19
lines changed
  • src/backend/access/transam

1 file changed

+20
-19
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.192 2004/10/16 18:57:22 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.193 2004/10/29 22:19:53 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1437,34 +1437,26 @@ CommitTransaction(void)
14371437
TransStateAsString(s->state));
14381438
Assert(s->parent==NULL);
14391439

1440+
/*
1441+
* Do pre-commit processing (most of this stuff requires database
1442+
* access, and in fact could still cause an error...)
1443+
*/
1444+
14401445
/*
14411446
* Tell the trigger manager that this transaction is about to be
14421447
* committed. He'll invoke all trigger deferred until XACT before we
14431448
* really start on committing the transaction.
14441449
*/
14451450
AfterTriggerEndXact();
14461451

1447-
/*
1448-
* Similarly, let ON COMMIT management do its thing before we start to
1449-
* commit.
1450-
*/
1451-
PreCommit_on_commit_actions();
1452-
1453-
/* Prevent cancel/die interrupt while cleaning up */
1454-
HOLD_INTERRUPTS();
1455-
1456-
/*
1457-
* set the current transaction state information appropriately during
1458-
* the abort processing
1459-
*/
1460-
s->state=TRANS_COMMIT;
1452+
/* Close open cursors */
1453+
AtCommit_Portals();
14611454

14621455
/*
1463-
*Do pre-commit processing (most of this stuff requires database
1464-
*access, and in fact could still cause an error...)
1456+
*Let ON COMMIT management do its thing (must happen after closing
1457+
*cursors, to avoid dangling-reference problems)
14651458
*/
1466-
1467-
AtCommit_Portals();
1459+
PreCommit_on_commit_actions();
14681460

14691461
/* close large objects before lower-level cleanup */
14701462
AtEOXact_LargeObject(true);
@@ -1476,6 +1468,15 @@ CommitTransaction(void)
14761468
/* This should be the last step before commit */
14771469
AtEOXact_UpdatePasswordFile(true);
14781470

1471+
/* Prevent cancel/die interrupt while cleaning up */
1472+
HOLD_INTERRUPTS();
1473+
1474+
/*
1475+
* set the current transaction state information appropriately during
1476+
* the abort processing
1477+
*/
1478+
s->state=TRANS_COMMIT;
1479+
14791480
/*
14801481
* Here is where we really truly commit.
14811482
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp