Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA27855; Thu, 30 Jul 92 16:30:21 -0700
Message-Id: <9207302330.AA27855@postgres.Berkeley.EDU>
From: <mao@postgres.berkeley.edu>
Subject: Re: append problem
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Thu, 30 Jul 92 16:11:26 PST.
             <9207302311.AA27487@postgres.Berkeley.EDU> 
Date: Thu, 30 Jul 92 16:41:03 PDT

In message <9207302311.AA27487@postgres.Berkeley.EDU> you write:
> The following series of commands hang-up the system.

> create auto
>         (serial = char16,
>         style = char16,
>         color = char16,
>         price = int4,
>         category = char16)

> define rule CatEconomy is
> on append to auto
>    where new.price >= 10000
>      and new.price <  20000
>    do instead append auto
>       (serial = new.serial,
>        style  = new.style,
>        color  = new.color,
>        price  = new.price,
>      category = "Economy")

> append auto
>         (serial="2222",
>          style="sedan",
>          color="red",
>          price=15000)

when you append your auto tuple, you fire the CatEconomy rule.  CatEconomy
appends a tuple to auto that satisfies the requirements for firing the
CatEconomy rule, so it fires on its own output.  this continues forever.

you should reformulate your rule so that it changes some condition in
the tuple, and keeps itself from firing forever.

					mike olson
					project sequoia 2000
					uc berkeley
					mao@cs.berkeley.edu
