Re: Bug #822: Condition on rule is not respected.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: <lhrm(at)iscte(dot)pt>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug #822: Condition on rule is not respected.
Date: 2002-11-24 18:11:00
Message-ID: 20021124095823.I42217-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Sat, 23 Nov 2002 pgsql-bugs(at)postgresql(dot)org wrote:

> Lus Mota (lhrm(at)iscte(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Theodore Petrosky 2002-11-24 19:37:18 pg_dump and Mac osx
Previous Message Tom Lane 2002-11-24 17:57:24 Re: pg_dump/pg_restore