| От | Tom Lane |
|---|---|
| Тема | Re: Update timestamp on update |
| Дата | |
| Msg-id | 16305.1129167889@sss.pgh.pa.us обсуждение |
| Ответ на | Update timestamp on update (Jeff Williams <jeffw@globaldial.com>) |
| Ответы |
Re: Update timestamp on update
|
| Список | pgsql-sql |
Jeff Williams <jeffw@globaldial.com> writes: > last_status_change timestamp DEFAULT now() > What I would like is that whenever the status is changed the > last_status_change timestamp is updated to the current time. For this you use an ON UPDATE trigger; rules are not a good way to solve it. See the documentation about triggers. The first example on this page does it along with a few other things: http://developer.postgresql.org/docs/postgres/plpgsql-trigger.html regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера