Re: Foreign key reference causes invalid DELETE trigger calls

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Foreign key reference causes invalid DELETE trigger calls
Дата
Msg-id 18262.1131563265@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Foreign key reference causes invalid DELETE trigger calls  ("Andrus" <eetasoft@online.ee>)
Список pgsql-general
"Andrus" <eetasoft@online.ee> writes:
> Postgres 8.1 calls "foo" delete trigger when record is deleted from master
> table "klient". Why ?

Because you have an ON DELETE CASCADE.  That leads to a DELETE ... WHERE ...
on the slave table; whether any records actually get deleted depends on
what the DELETE finds.  This is a general hazard of using STATEMENT
triggers: you have no info about whether the statement actually did
anything.  (It's rather silly to imagine that a BEFORE STATEMENT trigger
would have any way to know that anyway.  We currently don't tell an
AFTER STATEMENT trigger anything either; though that may change
someday.)

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Hanging creating of function
Следующее
От: "Mikael Carneholm"
Дата:
Сообщение: Re: Hanging creating of function