Re: Touch row ?

From: "Chris Boget" <chris(at)wild(dot)net>
To: "Doug McNaught" <doug(at)mcnaught(dot)org>
Cc: "PostgreSQL-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Touch row ?
Date: 2004-01-23 16:08:21
Message-ID: 01f001c3e1cb$20dcae50$8c01a8c0@ENTROPY
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce 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

In response to

Responses

Browse pgsql-announce by date

  From Date Subject
Next Message Richard Huxton 2004-01-23 16:09:16 Re: Touch row ?
Previous Message Csaba Nagy 2004-01-23 16:04:07 Re: Touch row ?

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-01-23 16:09:16 Re: Touch row ?
Previous Message Csaba Nagy 2004-01-23 16:04:07 Re: Touch row ?