Re: [SQL] auto datetime update on UPDATE?

Поиск
Список
Период
Сортировка
От Darrin Crook
Тема Re: [SQL] auto datetime update on UPDATE?
Дата
Msg-id Pine.LNX.4.10.9911010841220.29107-100000@nexus.as.utexas.edu
обсуждение исходный текст
Ответ на auto datetime update on UPDATE?  (Tulassay Zsolt <zsolt@tek.bke.hu>)
Список pgsql-sql
This is wat I have done to solve the problem.

UPDATE table SET modification_dt = datetime('now'::abstime);

You can update any other field at the same time. This enters the date-time
stamp into the filed. And you can use this format for INSET INTO also.

I hope this helps.

Darrin Crook                crook@nexus.as.utexas.edu
McDonald Observatory            wk: 915-426-4167
The University of Texas at Austin    hm: 915-426-3652

On Sun, 31 Oct 1999, Tulassay Zsolt wrote:
> i have set up a table, where two fields (creation_dt and modification_dt)
> always get the actual date/time by default when doing an INSERT.
> my question is, how is it possible to let the field modification_dt
> change when doing an UPDATE?
> Is there a way to solve it in SQL?



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

Предыдущее
От: Baris Ulu
Дата:
Сообщение: Rule plan string too big is overcome, but...
Следующее
От: Oskar Liljeblad
Дата:
Сообщение: query with subquery abnormally slow?