Create Rule - Mailing list pgsql-novice

From Luc ROLLAND
Subject Create Rule
Date
Msg-id 000c01c3f590$e9809640$0100a8c0@lrp42600
Whole thread Raw
Responses Re: Create Rule
List 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

pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: INSERT or COPY: Which one?
Next
From: "Sugrue, Sean"
Date:
Subject: Big databases vs small databases