Re: Create a function that updates the record with and timestamps

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Create a function that updates the record with and timestamps
Дата
Msg-id 20100322171400.GA14658@a-kretschmer.de
обсуждение исходный текст
Ответ на Create a function that updates the record with and timestamps  (Chris Barnes <compuguruchrisbarnes@hotmail.com>)
Ответы Re: Create a function that updates the record with and timestamps  (Chris Barnes <compuguruchrisbarnes@hotmail.com>)
Список pgsql-general
In response to Chris Barnes :
> I would like to have postgres update the last_modified column with the
> current_date on an update of the record.
>
> I am not sure if there is a very simple way of doing this?
>
> Or, do I need to create a function and a trigger to call the row and update
> with new data and set the last_modified to current_date?

Yes, that's the way, a TRIGGER on UPDATE for each row. I think, the doc
contains an example.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

В списке pgsql-general по дате отправления:

Предыдущее
От: Szymon Guz
Дата:
Сообщение: Re: strange
Следующее
От: "Bob Pawley"
Дата:
Сообщение: Postgresql error from interface