Re: Rule WHERE condition problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kristian Eide" <kreide(at)online(dot)no>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rule WHERE condition problem
Date: 2002-07-09 13:23:05
Message-ID: 3454.1026220985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Kristian Eide" <kreide(at)online(dot)no> 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
ON UPDATE TO b DO UPDATE b ...
because it *will* be an infinite loop, condition or no condition.

Consider using a trigger instead.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kristian Eide 2002-07-09 13:41:43 Re: Rule WHERE condition problem
Previous Message Jan Wieck 2002-07-09 13:00:13 Re: Rule WHERE condition problem