postgresql/src
Alvaro Herrera 8c848cd4b8
Fix GetForeignKey*Triggers for self-referential FKs
Because of inadequate filtering, the check triggers were confusing the
search for action triggers in GetForeignKeyActionTriggers and vice-versa
in GetForeignKeyCheckTriggers; this confusion results in seemingly
random assertion failures, and can have real impact in non-asserting
builds depending on catalog order.  Change these functions so that they
correctly ignore triggers that are not relevant to each side.

To reduce the odds of further problems, do not break out of the
searching loop in assertion builds.  This break is likely to hide bugs;
without it, we would have detected this bug immediately.

This problem was introduced by f4566345cf, so backpatch to 15 where
that commit first appeared.

Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/20220908172029.sejft2ppckbo6oh5@awork3.anarazel.de
Discussion: https://postgr.es/m/4104619.1662663056@sss.pgh.pa.us
2022-09-09 12:22:20 +02:00
..
backend Fix GetForeignKey*Triggers for self-referential FKs 2022-09-09 12:22:20 +02:00
bin Replace load of functions by direct calls for some WIN32 2022-09-09 10:52:17 +09:00
common Replace load of functions by direct calls for some WIN32 2022-09-09 10:52:17 +09:00
fe_utils Clean up inconsistent use of fflush(). 2022-08-29 13:55:41 -04:00
include Fix recovery_prefetch with low maintenance_io_concurrency. 2022-09-08 21:44:55 +12:00
interfaces Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
makefiles aix: when building with gcc, tell gcc we're building a shared library 2022-09-01 11:49:36 -07:00
pl Bump minimum version of Bison to 2.3 2022-09-09 12:31:41 +07:00
port Cleanup more code and comments related to Windows NT4 (XP days) 2022-08-30 09:52:58 +09:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Choose FK name correctly during partition attachment 2022-09-08 13:17:02 +02:00
timezone Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
tools Bump minimum version of Flex to 2.5.35 2022-09-09 12:55:23 +07:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Remove unused configure variable. 2022-08-18 11:22:13 -04:00
Makefile.shlib aix: Fix SHLIB_EXPORTS reference in VPATH builds 2022-08-24 20:39:46 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00