Re: Touch row ?

Поиск
Список
Период
Сортировка
От Chris Boget
Тема Re: Touch row ?
Дата
Msg-id 01f001c3e1cb$20dcae50$8c01a8c0@ENTROPY
обсуждение исходный текст
Ответ на Re: Upcoming events  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Csaba Nagy
Дата:
Сообщение: Re: Touch row ?
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Touch row ?