Re: BUG #14114: FK on-delete-cascade trouble

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14114: FK on-delete-cascade trouble
Дата
Msg-id 27918.1461680327@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14114: FK on-delete-cascade trouble  (zha-vova@yandex.ru)
Список pgsql-bugs
zha-vova@yandex.ru writes:
> After creating a FK constraint with "on delete cascade" option I got a
> problem with before-delete-trigger on a dependent table. This short listing
> below will make it clear:

This is not a bug, this is expected behavior.  If you have a trigger that
interferes with the updates commanded by a foreign key cascade query,
you'll break the integrity of the FK.  The only way we could prevent that
is to not run triggers for FK cascade updates; which is a cure worse than
the disease, since there are plenty of legitimate reasons why you'd want
a table's triggers to fire.

Write your triggers more carefully.

            regards, tom lane

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

Предыдущее
От: zha-vova@yandex.ru
Дата:
Сообщение: BUG #14114: FK on-delete-cascade trouble
Следующее
От: andreas.schmidt1982@googlemail.com
Дата:
Сообщение: BUG #14115: PostgreSQL stopped listening to ip address