Create Rule

From: "Luc ROLLAND" <luc(at)rolland-fr(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Create Rule
Date: 2004-02-17 20:01:51
Message-ID: 000c01c3f590$e9809640$0100a8c0@lrp42600
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello !

I would use a rule to store in each modified records the name of the user and the date of modification.
I try :

CREATE RULE shoe_mod AS ON UPDATE TO shoe_data
DO INSTEAD UPDATE shoe_data
SET shoename = NEW.shoename,
sh_avail = NEW.sh_avail,
slcolor = NEW.slcolor,
slminlen = NEW.slminlen,
slmaxlen = NEW.slmaxlen,
slunit = NEW.slunit,
shuser = current_user,
shdatmod = current_date
WHERE shoename = OLD.shoename ;

but I obtain an infinite loop ...
How can I do that.

Best regards.

Luc ROLLAND

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jeremy Semeiks 2004-02-17 21:14:15 Re: Create Rule
Previous Message Nabil Sayegh 2004-02-17 20:01:41 Re: INSERT or COPY: Which one?