Re: Touch row ? - Mailing list pgsql-general

From Doug McNaught
Subject Re: Touch row ?
Date
Msg-id 87ptday7ru.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Re: Touch row ?  ("Chris Boget" <chris@wild.net>)
List pgsql-general
"Chris Boget" <chris@wild.net> writes:

>> > 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.

-Doug

pgsql-general by date:

Previous
From: "Chris Boget"
Date:
Subject: Re: Touch row ?
Next
From: Csaba Nagy
Date:
Subject: Re: Touch row ?