postgresql/src
Alvaro Herrera f4566345cf
Create foreign key triggers in partitioned tables too
While user-defined triggers defined on a partitioned table have
a catalog definition for both it and its partitions, internal
triggers used by foreign keys defined on partitioned tables only
have a catalog definition for its partitions.  This commit fixes
that so that partitioned tables get the foreign key triggers too,
just like user-defined triggers.  Moreover, like user-defined
triggers, partitions' internal triggers will now also have their
tgparentid set appropriately.  This is to allow subsequent commit(s)
to make the foreign key related events to be fired in some cases
using the parent table triggers instead of those of partitions'.

This also changes what tgisinternal means in some cases.  Currently,
it means either that the trigger is an internal implementation object
of a foreign key constraint, or a "child" trigger on a partition
cloned from the trigger on the parent.  This commit changes it to
only mean the former to avoid confusion.  As for the latter, it can
be told by tgparentid being nonzero, which is now true both for user-
defined and foreign key's internal triggers.

Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Arne Roland <A.Roland@index.de>
Discussion: https://postgr.es/m/CA+HiwqG7LQSK+n8Bki8tWv7piHD=PnZro2y6ysU2-28JS6cfgQ@mail.gmail.com
2022-01-05 19:00:13 -03:00
..
backend Create foreign key triggers in partitioned tables too 2022-01-05 19:00:13 -03:00
bin Create foreign key triggers in partitioned tables too 2022-01-05 19:00:13 -03:00
common Add fast path for validating UTF-8 text 2021-12-20 10:07:29 -04:00
fe_utils Rethink pg_dump's handling of object ACLs. 2021-12-06 12:39:45 -05:00
include Create foreign key triggers in partitioned tables too 2022-01-05 19:00:13 -03:00
interfaces Remove dynamic translation of regression test scripts, step 2. 2021-12-20 14:15:52 -05:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Revert changes about warnings/errors for placeholders. 2021-12-27 16:01:10 -05:00
port Check for STATUS_DELETE_PENDING on Windows. 2021-12-10 16:19:43 +13:00
template
test Create foreign key triggers in partitioned tables too 2022-01-05 19:00:13 -03:00
timezone Update time zone data files to tzdata release 2021e. 2021-10-29 11:38:18 -04:00
tools ci: Add continuous integration for github repositories via cirrus-ci. 2021-12-30 19:02:44 -08:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Add support for LZ4 compression in pg_receivewal 2021-11-05 11:33:25 +09:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00