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

Commit 0daf97c

Browse files
author
Commitfest Bot
committed
[CF 5679] Add comments about fire_triggers argument in ri_triggers.c
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5679 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/20250331212648.ad4ab804559001d7f0788741@sraoss.co.jp Author(s): Yugo Nagata
2 parents b7ab88d + 97e4b35 commit 0daf97c

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)