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 b7ab88d commit 97e4b35Copy full SHA for 97e4b35
src/backend/utils/adt/ri_triggers.c
@@ -2580,7 +2580,13 @@ ri_PerformCheck(const RI_ConstraintInfo *riinfo,
2580
save_sec_context | SECURITY_LOCAL_USERID_CHANGE |
2581
SECURITY_NOFORCE_RLS);
2582
2583
- /* Finally we can run the query. */
+ /*
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
+ */
2590
spi_result = SPI_execute_snapshot(qplan,
2591
vals, nulls,
2592
test_snapshot, crosscheck_snapshot,
0 commit comments