| От | grant@intekom.com |
|---|---|
| Тема | Adding a rule to update a last_changed field |
| Дата | |
| Msg-id | 221099295.28982@212.53.64.128 обсуждение исходный текст |
| Ответы |
Re: [SQL] Adding a rule to update a last_changed field
Re: [SQL] Adding a rule to update a last_changed field |
| Список | pgsql-sql |
I'm trying to use a rule to maintain a last_changed field. Using something like: CREATE RULE rule1 AS ON UPDATE TO thetable DO UPDATE thetable SET last_changed = now() WHERE id = new.id; This obviously doesn't work as the DO UPDATE triggers the rule again, thus looping meaninglessly. Is there a neat way to work around this? I'd like to just assign now() to the last_changed field before the actual SQL update code is run. Thanks ----- Sent using MailStart.com ( http://MailStart.Com/welcome.html ) The FREE way to access your mailbox via any web browser, anywhere!
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера