update rule loops

From: "Poul L(dot) Christiansen" <plc(at)faroenet(dot)fo>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: update rule loops
Date: 2000-08-18 15:01:36
Message-ID: 399D4FD0.11A258FB@faroenet.fo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi

I'm trying to make a field in my table (datechanged) to automatically be
updated with the value 'now()' when an update on the table occurs.

plc=# create rule datechanged_radius AS ON update to radius do update
radius set datechanged ='now()';
CREATE 22025360 1
plc=# update radius set destinationip = '212.055.059.001';
ERROR: query rewritten 10 times, may contain cycles

This means that it's going in a loop, because the rule triggers itself.

Is there another way to do this?

Thanks,
Poul L. Christiansen

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2000-08-18 15:18:07 Re: Continuous inserts...
Previous Message Yury Don 2000-08-18 14:07:11 Re: sequences in functions