Re: Touch row ? - Mailing list pgsql-general

From Chris Boget
Subject Re: Touch row ?
Date
Msg-id 01f001c3e1cb$20dcae50$8c01a8c0@ENTROPY
Whole thread Raw
In response to Re: Upcoming events  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
> >> > is it possible to add column to database, that will automatically
> >> > contain  date+time (or likely Unix timestamp) when the row was
> >> > touched/changed - ie by INSERT or UPDATE ?
> >> Yes, a very simple trigger can do this.
> > Wouldn't just setting the default value of the field to be NOW() accomplish
> > the same thing?  Or can you not default the value of a timestamp field?
> Defaults only apply at INSERT time, not UPDATE.

Interesting.  Yet another item to tack onto my list of differences between
MySQL and Postgres.

Thanks!

Chris


pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Touch row ?
Next
From: Richard Huxton
Date:
Subject: Re: Touch row ?