Re: BUG #6632: "before delete" triggers that delete rows from the same table can invalidate constraints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6632: "before delete" triggers that delete rows from the same table can invalidate constraints
Дата
Msg-id 26030.1336403170@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #6632: "before delete" triggers that delete rows from the same table can invalidate constraints  (ignas@pow.lt)
Ответы Re: BUG #6632: "before delete" triggers that delete rows from the same table can invalidate constraints
Список pgsql-bugs
ignas@pow.lt writes:
> [ you can sabotage foreign key constraints with triggers ]

This is not a bug, it's a "don't do that" issue.  The only way to
prevent it would be to not fire triggers during FK operations, or
to somehow restrict what triggers are allowed to do, and either of
those cures would be worse than the disease.

In general, it's bad design to use a BEFORE trigger to propagate changes
to other rows; you should do that in AFTER triggers.  See the
documentation.

            regards, tom lane

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

Предыдущее
От: picard_alfa_uno@hotmail.com
Дата:
Сообщение: BUG #6631: Error Intalation
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"