From: Kristian Eide <kreide@online.no>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Rule WHERE condition problem
Date: Tue, 9 Jul 2002 15:41:43 +0200
Message-ID: <3D2C1A19@epostleser.online.no> (raw)
>> 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.
OK, perhaps the documentation should state that recursive rules are not
supported.
>Consider using a trigger instead.
Yes, I have written a PL/pgsql function and a trigger for this, which seems to
work perfectly. A rule would have been much simpler though :)
Thanks.
---
Kristian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kreide@online.no, tgl@sss.pgh.pa.us
Subject: Re: Rule WHERE condition problem
In-Reply-To: <3D2C1A19@epostleser.online.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox