Re: "on insert" rules happen before the insert?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "on insert" rules happen before the insert?
Дата
Msg-id 21896.1073280414@sss.pgh.pa.us
обсуждение исходный текст
Ответ на "on insert" rules happen before the insert?  (treat00@yahoo.com (Thomas Reat))
Список pgsql-sql
treat00@yahoo.com (Thomas Reat) writes:
> The postgresql documentation claims that "on insert" rules are executed
> after the insert. This is not happening for me. I have a rule that is being
> executed even though the insert should have failed due to a foreign key check.

The INSERT certainly happens before any rules that it triggers.  But
foreign key checks probably don't happen until all the dust has settled.
This is arguably not a bug --- there are situations where it's essential.
        regards, tom lane


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

Предыдущее
От: "Iain"
Дата:
Сообщение: Re: not in vs not exists - vastly diferent performance
Следующее
От: "Kumar"
Дата:
Сообщение: Virtual records