Re: [SQL] auto datetime update on UPDATE? - Mailing list pgsql-sql

From Darrin Crook
Subject Re: [SQL] auto datetime update on UPDATE?
Date
Msg-id Pine.LNX.4.10.9911010841220.29107-100000@nexus.as.utexas.edu
Whole thread Raw
In response to auto datetime update on UPDATE?  (Tulassay Zsolt <zsolt@tek.bke.hu>)
List pgsql-sql
This is wat I have done to solve the problem.

UPDATE table SET modification_dt = datetime('now'::abstime);

You can update any other field at the same time. This enters the date-time
stamp into the filed. And you can use this format for INSET INTO also.

I hope this helps.

Darrin Crook                crook@nexus.as.utexas.edu
McDonald Observatory            wk: 915-426-4167
The University of Texas at Austin    hm: 915-426-3652

On Sun, 31 Oct 1999, Tulassay Zsolt wrote:
> i have set up a table, where two fields (creation_dt and modification_dt)
> always get the actual date/time by default when doing an INSERT.
> my question is, how is it possible to let the field modification_dt
> change when doing an UPDATE?
> Is there a way to solve it in SQL?



pgsql-sql by date:

Previous
From: Baris Ulu
Date:
Subject: Rule plan string too big is overcome, but...
Next
From: Oskar Liljeblad
Date:
Subject: query with subquery abnormally slow?