Re: Touch row ?

Поиск
Список
Период
Сортировка
Искать
От
Csaba Nagy
Тема
Re: Touch row ?
Дата
Msg-id
1074873847.14313.9.camel@coppola.ecircle.de
Ответ на
Re: Touch row ? (Chris Boget)
Список
Дерево обсуждения
Upcoming events Bruce Momjian <pgman@candle.pha.pa.us>
Re: Upcoming events Joseph Shraibman <jks@selectacast.net>
Re: Upcoming events Bruce Momjian <pgman@candle.pha.pa.us>
On Fri, 2004-01-23 at 16:52, Chris Boget wrote:
> > > 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?

No, that would only set the timestamp on INSERT, but not on any UPDATE.
The OP wanted to timestamp all updates too.

Cheers,
Csaba.

> 
> Chris
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

В списке pgsql-general по дате отправления
От: Doug McNaught
Дата:
Сообщение: Re: Touch row ?
От: Chris Boget
Дата:
Сообщение: Re: Touch row ?
FAQ