pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kristian Eide <kreide@online.no>
Cc: pgsql-sql@postgresql.org
Subject: Re: Rule WHERE condition problem
Date: Tue, 09 Jul 2002 09:23:05 -0400
Message-ID: <3454.1026220985@sss.pgh.pa.us> (raw)
In-Reply-To: <047101c226a7$36fb2da0$6b97f181@speed>
References: <047101c226a7$36fb2da0$6b97f181@speed>

"Kristian Eide" <kreide@online.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



view thread (4+ messages)  latest in thread

Message-ID: <3454.1026220985@sss.pgh.pa.us>
Permalink:  ../3454.1026220985@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3454.1026220985@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, kreide@online.no
  Subject: Re: Rule WHERE condition problem
  In-Reply-To: <3454.1026220985@sss.pgh.pa.us>

* 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