We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da2052a commit 66372e8Copy full SHA for 66372e8
src/backend/utils/adt/ri_triggers.c
@@ -2578,7 +2578,13 @@ ri_PerformCheck(const RI_ConstraintInfo *riinfo,
2578
save_sec_context | SECURITY_LOCAL_USERID_CHANGE |
2579
SECURITY_NOFORCE_RLS);
2580
2581
- /* Finally we can run the query. */
+ /*
2582
+ * Finally we can run the query.
2583
+ *
2584
+ * Set fire_triggers to false so that AFTER triggers run at the end of
2585
+ * the query. This ensures check triggers fire after all RI updates on
2586
+ * the same row are complete.
2587
+ */
2588
spi_result = SPI_execute_snapshot(qplan,
2589
vals, nulls,
2590
test_snapshot, crosscheck_snapshot,
0 commit comments