Re: Re: AfterTriggerSaveEvent() Error on altered foreign key cascaded delete

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martin <hier-bei-mir(at)gmx(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: AfterTriggerSaveEvent() Error on altered foreign key cascaded delete
Date: 2017-04-26 16:30:02
Message-ID: 6536.1493224202@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Martin <hier-bei-mir(at)gmx(dot)net> writes:
> I am facing the exact same bug when using circular references:

I see no error when I try this example in HEAD. I think possibly you
are hitting a bug we fixed last year:

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Branch: master [a522fc3d8] 2016-10-26 17:05:06 -0400
Branch: REL9_6_STABLE Release: REL9_6_2 [445035a6e] 2016-10-26 17:05:06 -0400
Branch: REL9_5_STABLE Release: REL9_5_6 [b53c841e5] 2016-10-26 17:05:06 -0400
Branch: REL9_4_STABLE Release: REL9_4_11 [3a9a8c408] 2016-10-26 17:05:06 -0400

Fix incorrect trigger-property updating in ALTER CONSTRAINT.

The code to change the deferrability properties of a foreign-key constraint
updated all the associated triggers to match; but a moment's examination of
the code that creates those triggers in the first place shows that only
some of them should track the constraint's deferrability properties. This
leads to odd failures in subsequent exercise of the foreign key, as the
triggers are fired at the wrong times. Fix that, and add a regression test
comparing the trigger properties produced by ALTER CONSTRAINT with those
you get by creating the constraint as-intended to begin with.

Per report from James Parks. Back-patch to 9.4 where this ALTER
functionality was introduced.

Report: <CAJ3Xv+jzJ8iNNUcp4RKW8b6Qp1xVAxHwSXVpjBNygjKxcVuE9w(at)mail(dot)gmail(dot)com>

If you're not running a current minor release, please update.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2017-04-26 17:48:13 Re: Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Martin 2017-04-26 16:18:56 Re: AfterTriggerSaveEvent() Error on altered foreign key cascaded delete