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

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Bug #822: Condition on rule is not respected.
Дата
Msg-id 20021124095823.I42217-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Bug #822: Condition on rule is not respected.  (pgsql-bugs@postgresql.org)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump/pg_restore
Следующее
От: Theodore Petrosky
Дата:
Сообщение: pg_dump and Mac osx