Re: conditional rule not applied - Mailing list pgsql-general

From Scott Marlowe
Subject Re: conditional rule not applied
Date
Msg-id dcc563d11001072004g61eb217bjdfe7475737473a59@mail.gmail.com
Whole thread Raw
In response to conditional rule not applied  (Seb <spluque@gmail.com>)
List pgsql-general
On Wed, Dec 30, 2009 at 6:39 PM, Seb <spluque@gmail.com> wrote:
> CREATE RULE footwear_nothing_upd AS
>    ON UPDATE TO footwear DO INSTEAD NOTHING;
> CREATE RULE footwear_newshoelaces_upd AS
>    ON UPDATE TO footwear
>    WHERE NEW.sl_name <> OLD.sl_name AND OLD.sl_name IS NULL
>    DO
> INSERT INTO shoelaces (sh_id, sl_name)
>    VALUES(NEW.sh_id, NEW.sl_name);

Isn't that first rule gonna always fire and make the second one a NOOP?

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: After a crash all my tables got wiped, but still using disk space.
Next
From: akp geek
Date:
Subject: Index question on postgres