Re: conditional rule not applied

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Seb <spluque(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: conditional rule not applied
Date: 2010-01-08 04:04:45
Message-ID: dcc563d11001072004g61eb217bjdfe7475737473a59@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 30, 2009 at 6:39 PM, Seb <spluque(at)gmail(dot)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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message akp geek 2010-01-08 04:11:13 Index question on postgres
Previous Message Craig Ringer 2010-01-08 04:00:17 Re: After a crash all my tables got wiped, but still using disk space.