on update of table set timestamp

Поиск
Список
Период
Сортировка
От Campbell, Lance
Тема on update of table set timestamp
Дата
Msg-id B10E6810AC2A2F4EA7550D072CDE876004B2E5C0@SAB-FENWICK.sab.uiuc.edu
обсуждение исходный текст
Ответы Re: on update of table set timestamp
Список pgsql-admin

PostgreSQL 8.4

I want to add a timestamp column to some of my important table such that whenever an SQL “update” command is executed on the table the “updated_timestamp” timestamp column would be set with “now()”.  Is there a way to do this?  I know I could go through and change my SQL all over the place to update a column “updated_timestamp” with “now()” but it would be faster if there was some way to set a constraint and/or default value on the field.  Is this possible.  I don’t really want to do store procedures.

 

Thanks,

 

Lance Campbell

Software Architect/DBA/Project Manager

Web Services at Public Affairs

217-333-0382

 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: blocking automatic vacuum
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: on update of table set timestamp