Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 97e4b35

Browse files
author
Commitfest Bot
committed
[PATCH]: ./add_comments_fire_triggers_in_ri_triggers.patch
1 parent b7ab88d commit 97e4b35

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/utils/adt/ri_triggers.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2580,7 +2580,13 @@ ri_PerformCheck(const RI_ConstraintInfo *riinfo,
25802580
save_sec_context | SECURITY_LOCAL_USERID_CHANGE |
25812581
SECURITY_NOFORCE_RLS);
25822582

2583-
/* Finally we can run the query. */
2583+
/*
2584+
* Finally we can run the query.
2585+
*
2586+
* Set fire_triggers to false so that AFTER triggers run at the end of
2587+
* the query. This ensures check triggers fire after all RI updates on
2588+
* the same row are complete.
2589+
*/
25842590
spi_result = SPI_execute_snapshot(qplan,
25852591
vals, nulls,
25862592
test_snapshot, crosscheck_snapshot,

0 commit comments

Comments
 (0)