postgresql/src
Alvaro Herrera 68b0da6779
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 Translation updates 2022-09-05 14:37:22 +02:00
common Fix get_dirent_type() for symlinks on MinGW/MSYS. 2022-07-28 14:27:28 +12:00
fe_utils Use correct connection for cancellation in frontend's parallel slots 2022-08-27 15:22:07 +09:00
include Fix recovery_prefetch with low maintenance_io_concurrency. 2022-09-08 20:36:44 +12:00
interfaces Translation updates 2022-09-05 14:37:22 +02:00
makefiles Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
pl Translation updates 2022-09-05 14:37:22 +02:00
port Fix get_dirent_type() for Windows junction points. 2022-07-22 16:57:36 +12:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:28:55 -04:00
test Choose FK name correctly during partition attachment 2022-09-08 13:17:02 +02:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:54:53 -04:00
tools Revert SQL/JSON features 2022-09-01 17:10:42 -04:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Increase minimum supported GNU make version to 3.81. 2022-07-23 12:12:42 -04:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Improve frontend error logging style. 2022-04-08 14:55:14 -04:00