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

Commitd5df606

Browse files
committed
ActiveSnapshot must be set to something valid while running deferred
triggers during COMMIT. Per trouble report from Frank van Vugt.
1 parente514da6 commitd5df606

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/backend/commands/trigger.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.175 2004/11/14 02:04:14 neilc Exp $
10+
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.176 2004/12/06 23:57:17 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -2364,6 +2364,14 @@ AfterTriggerEndXact(void)
23642364
/* ... but not inside a query */
23652365
Assert(afterTriggers->query_depth==-1);
23662366

2367+
/*
2368+
* If there are any triggers to fire, make sure we have set a snapshot
2369+
* for them to use. (Since PortalRunUtility doesn't set a snap for
2370+
* COMMIT, we can't assume ActiveSnapshot is valid on entry.)
2371+
*/
2372+
if (afterTriggers->events.head!=NULL)
2373+
ActiveSnapshot=CopySnapshot(GetTransactionSnapshot());
2374+
23672375
/*
23682376
* Run all the remaining triggers. Loop until they are all gone,
23692377
* just in case some trigger queues more for us to do.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp