automatic time/user stamp - rule or trigger?

Поиск
Список
Период
Сортировка
От Neal Lindsay
Тема automatic time/user stamp - rule or trigger?
Дата
Msg-id b1r864$2mpp$1@news.hub.org
обсуждение исходный текст
Ответы Re: automatic time/user stamp - rule or trigger?  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-sql
I have a table that I want to keep track of the user who last modified 
it and the timestamp of the modification. Should I use a trigger or a rule?

CREATE TABLE stampedtable (stampedtableid SERIAL PRIMARY KEY,updatestamp timestamp NOT NULL DEFAULT now(),updateuser
nameNOT NULL DEFAULT current_user,sometext text
 
);

I suspect that I want a rule, but all the examples in the documentation 
seem to update a separate table and not override (or add) the 
insert/update to the timestamp and name columns.

Thanks,
-Neal



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

Предыдущее
От: Marcelo Pereira Tada
Дата:
Сообщение: Problem with VACUUM
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [ADMIN] Problem with VACUUM