Re: BUG #17886: Error disabling user triggers on a partitioned table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17886: Error disabling user triggers on a partitioned table
Дата
Msg-id 1582614.1680632672@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #17886: Error disabling user triggers on a partitioned table  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17886: Error disabling user triggers on a partitioned table  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> result:
> postgres=# alter table public.test DISABLE TRIGGER USER;
> ERROR:  42704: trigger "trigger_test" for table "test_def" does not exist
> LOCATION:  EnableDisableTriggerNew, trigger.c:1658

> Expected Result (Postgresql 15.2 and 14.4 - fine):
> testdb=> alter table public.test DISABLE TRIGGER USER;
> ALTER TABLE

Commit ec0925c22 seems to have been quite snakebit.  I already fixed
a deficiency in it in v15/HEAD, but here we have a different symptom
in the older branches.  What's happening is that EnableDisableTrigger
is ignoring the child trigger because it has tgisinternal set to true
and the command passes skip_system = true.

I'm inclined to think that in the older branches (pre f4566345c)
we need to do

-       if (oldtrig->tgisinternal)
+       if (oldtrig->tgisinternal && !OidIsValid(oldtrig->tgparentid))
        {
            /* system trigger ... ok to process? */

but I've not tested that.  Alvaro, what do you think?

            regards, tom lane



В списке pgsql-bugs по дате отправления:

Предыдущее
От: jazzl 0013
Дата:
Сообщение: Re: BUG #17886: Error disabling user triggers on a partitioned table
Следующее
От: David Rowley
Дата:
Сообщение: Re: BUG #17885: slow planning constraint_exclusion