Re: [SQL] Rule WHERE condition problem

2002-07-09 Thread Jan Wieck
Kristian Eide wrote: > > I have a table with a reference constraint and an ON DELETE SET NULL action. > When this action triggers, I also want to update another field in the table, > actually a timestamp which should be set to NOW(). > > After reading some documentation it would seem a rule is t

Re: [SQL] Rule WHERE condition problem

2002-07-09 Thread Kristian Eide
>> ERROR: query rewritten 10 times, may contain cycles >> It would seem that my WHERE clause is not checked before the action is run. >No, the WHERE clause is essentially transformed into part of the rule >query. You can't ever write a rule of the form > ON UPDATE TO b DO UPDATE b ... >bec

Re: [SQL] Rule WHERE condition problem

2002-07-09 Thread Tom Lane
"Kristian Eide" <[EMAIL PROTECTED]> writes: > ERROR: query rewritten 10 times, may contain cycles > It would seem that my WHERE clause is not checked before the action is run. No, the WHERE clause is essentially transformed into part of the rule query. You can't ever write a rule of the form