Re: Delete rule chain stops unexpectedly

Поиск
Список
Период
Сортировка
От Wiebe Cazemier
Тема Re: Delete rule chain stops unexpectedly
Дата
Msg-id 435E4F7C.5060108@gmail.com
обсуждение исходный текст
Ответ на Re: Delete rule chain stops unexpectedly  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Delete rule chain stops unexpectedly
Список pgsql-sql
Tom Lane wrote:
>>So, the actual delete should be done after all the rules. And even if
>>it does delete before anything else, that does not explain why "step2"
>>is not inserted into the debuglog table.
> 
> 
> Because the rule converts those inserts into, effectively,
> 
>     INSERT INTO debuglog SELECT ... WHERE EXISTS(some matching OLD row);
> 
> and there are no longer any matching OLD rows in the view.  (If it
> didn't act that way then the INSERTs would execute even for a "DELETE
> WHERE false".  If you find any of this surprising or not what you want,
> you should probably be using triggers not rules.)

I've got a late addition question about this.

Is this behaviour also present in Postgres 7? I am continuing on work that was 
done by someone else in version 7. He said that what he made worked fine and 
tested OK, but with what you told me in mind, what he made can't possibly work 
(and it didn't when I tested it, and I have postgres 8).


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

Предыдущее
От: "codeWarrior"
Дата:
Сообщение: Re: automatic update or insert
Следующее
От: george young
Дата:
Сообщение: 8.0.x windows installer fails?