Re: BUG #17817: DISABLE TRIGGER ALL on a partitioned table with foreign key fails

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: ahodgson(at)simkin(dot)ca, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17817: DISABLE TRIGGER ALL on a partitioned table with foreign key fails
Date: 2023-03-03 19:33:34
Message-ID: 2614795.1677872014@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
>> I wonder how come this problem took so long to be detected with Ruby on
>> Rails; it's been in released 13.x and 14.x for seven months now.

> Um ... 13.x and 14.x aren't showing the problem, or is there something
> I missed?

Oh! Running the same test shows that while 12.x through 14.x do not
throw an error, they don't disable the child table's triggers either.

Moreover, we can't apply this fix idea since there is no tgparentid
linkage (or indeed any parent trigger to link to).

It's not hard to see one way to fix it: if the initial call is "for
all triggers", forget about recursing for individual triggers and
instead recursively do a "for all triggers" on the child. However,
that would be the sort of semantics change that people tend to bitch
about in stable branches, because it'd nuke non-inherited triggers
too.

I'm kind of inclined to leave things alone pre-v15. I asssume the
existing behavior had been that way all along, or do you have reason
to think it changed recently in those branches?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2023-03-04 06:00:00 Re: BUG #17821: Assertion failed in heap_update() due to heap pruning
Previous Message Tom Lane 2023-03-03 18:41:26 Re: BUG #17817: DISABLE TRIGGER ALL on a partitioned table with foreign key fails