Re: Touch row ?

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "Chris Boget" <chris(at)wild(dot)net>
Cc: "Dustin Sallings" <dustin(at)spy(dot)net>, "NTPT" <ntpt(at)centrum(dot)cz>, "PostgreSQL-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Touch row ?
Date: 2004-01-23 16:00:37
Message-ID: 87ptday7ru.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce pgsql-general

"Chris Boget" <chris(at)wild(dot)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

In response to

Responses

Browse pgsql-announce by date

  From Date Subject
Next Message Csaba Nagy 2004-01-23 16:04:07 Re: Touch row ?
Previous Message Chris Boget 2004-01-23 15:52:04 Re: Touch row ?

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2004-01-23 16:04:07 Re: Touch row ?
Previous Message Chris Boget 2004-01-23 15:52:04 Re: Touch row ?