Re: Bug #822: Condition on rule is not respected. - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: Bug #822: Condition on rule is not respected.
Date
Msg-id 20021124095823.I42217-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Bug #822: Condition on rule is not respected.  (pgsql-bugs@postgresql.org)
List pgsql-bugs
On Sat, 23 Nov 2002 pgsql-bugs@postgresql.org wrote:

> Lu=EDs Mota (lhrm@iscte.pt) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> Condition on rule is not respected.
>
> Long Description

> I think I spoted a bug while developing a database. To better
> understand if this was really a bug, I developed a small example that
> I include further down.
>
> The question is that I want to write a rule that inserts a record in a
> second table (table B) each time a record is inserted on a first table
> A, and vice-versa.
>
> To do this, I wrote two insert rules. To avoid a dead-lock, I created
> a boolean field which serves as guard to the insertion. Unfortunatly,
> I think that the condition I set up in the insert rules is not
> respected.

The rule where condition does not stop the rule from being expanded.  It
changes the rows that are acted upon, but not whether or not the rule
action occurs.  If you're looking to do something like that, you probably
actually need a trigger.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump/pg_restore
Next
From: Theodore Petrosky
Date:
Subject: pg_dump and Mac osx