Updating a date field

From: "Dan C" <danc(at)bspmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Updating a date field
Date: 2002-08-19 20:35:47
Message-ID: ajrkph$2qi0$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a date field called "updated" with a default of now.
When I INSERT data it the field displays today's date.
My problem is when I UPDATE the row it doesn't change unless
I update the field manually like this:
UPDATE person SET email='doe(at)foo(dot)com',updated='now()' WHERE
person_id=614486;
Is there an automatic way?
I tried doing it with a rule, which returned
ERROR: query rewritten 10 times, may contain cycles
I tried a CONSTRAINT and TRIGGER without any luck either.
Can anyone help?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert J. Sanford, Jr. 2002-08-19 20:58:42 PostgreSQL and MySQL in ZDNet article...
Previous Message Ian Harding 2002-08-19 19:34:30 Sorry...