Skip site navigation (1) Skip section navigation (2)

Update rule

From: Secrétariat <ets(at)rolland-fr(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Update rule
Date: 2004-12-30 17:35:23
Message-ID: 009e01c4ee96$7ad28aa0$0100a8c0@lrp43008 (view raw or flat)
Thread:
Lists: pgsql-general
Hello !

I wish to create a rule to write in records who and when modified them.
I wrote :
CREATE OR REPLACE RULE tarif_upd AS
   ON UPDATE TO tarifs
   DO ALSO 
      UPDATE tarifs
            SET dmodtar = current_date, umodtar = current_user
      WHERE dmodtar <> current_date AND umodtar <> current_user ;
But I obtain an infinite recursion !
It seems not using the where clause ?
Is it a bug ?
How can I workaround ...

Best regards.
Luc

Responses

pgsql-general by date

Next:From: Pierre-Frédéric CaillaudDate: 2004-12-30 18:08:20
Subject: Re: Update rule
Previous:From: Scott MarloweDate: 2004-12-30 17:22:19
Subject: Re: pg_dump and pgpool

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group