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

Поиск
Список
Период
Сортировка
От Ignas Mikalajunas
Тема Re: BUG #6632: "before delete" triggers that delete rows from the same table can invalidate constraints
Дата
Msg-id CAKMRbDa50YaSs_qcGVY7jX=dhL2BETMMCsCUHPPo672ObaO4pQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6632: "before delete" triggers that delete rows from the same table can invalidate constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Mon, May 7, 2012 at 6:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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. =A0The 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. =A0See the
> documentation.
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0regards, tom lane

I see, thank you very much for the explanation.

Ignas

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

Предыдущее
От: tom Tom
Дата:
Сообщение: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken"
Следующее
От: Robert Haas
Дата:
Сообщение: Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings