pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab
От | Tom Lane |
---|---|
Тема | pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab |
Дата | |
Msg-id | E1pk6RG-001WJV-9M@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tables. In v13 and v14, the ENABLE/DISABLE TRIGGER USER variant malfunctioned on cloned triggers, failing to find the clones because it thought they were system triggers. Other variants of ENABLE/DISABLE TRIGGER would improperly apply a superuserness check. Fix by adjusting the is-it- a-system-trigger check to match reality in those branches. (As far as I can find, this is the only place that got it wrong.) There's no such bug in v15/HEAD, because we revised the catalog representation of system triggers to be what this code was expecting. However, add the test case to these branches anyway, because this area is visibly pretty fragile. Also remove an obsoleted comment. The recent v15/HEAD commit 6949b921d fixed a nearby bug. I now see that my commit message for that was inaccurate: the behavior of recursing to clone triggers is older than v15, but it didn't apply to the case in v13/v14 because in those branches parent partitioned tables have no pg_trigger entries for foreign-key triggers. But add the test case from that commit to v13/v14, just to show what is happening there. Per bug #17886 from DzmitryH. Discussion: https://postgr.es/m/17886-5406d5d828aa4aa3@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0a6aaf01166c5f8f94abba949b92b2003c7fe9b5 Modified Files -------------- src/backend/commands/trigger.c | 2 +- src/test/regress/expected/triggers.out | 39 ++++++++++++++++++++++++++++++++++ src/test/regress/sql/triggers.sql | 21 ++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-)
В списке pgsql-committers по дате отправления: