"on insert" rules happen before the insert?

Поиск
Список
Период
Сортировка
От treat00@yahoo.com (Thomas Reat)
Тема "on insert" rules happen before the insert?
Дата
Msg-id 3c4289ad.0312301349.2e9ac46f@posting.google.com
обсуждение исходный текст
Ответы Re: "on insert" rules happen before the insert?
Список pgsql-sql
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 rule does an insert that is failing, and the whole insert fails. So in 
this case it's not a huge problem. But I get a completely useless error 
message, and as far as I can tell there is no way to determine exactly what
caused the failure (except for the fact that I happen to know what rule
can cause that error). 

I'd like the person inserting a row that violates the foreign key check to
get a useful error message.

Is this a documentation bug? How can I get the desired behavior?


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

Предыдущее
От: Chris Gamache
Дата:
Сообщение: Historic Query using a view/function ?
Следующее
От: Randolf Richardson
Дата:
Сообщение: Re: not in vs not exists - vastly diferent performance