Re: problems with date

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: problems with date
Дата
Msg-id 41C7E6E6.2030102@archonet.com
обсуждение исходный текст
Ответ на problems with date  (Jamie Deppeler <jamie@doitonce.net.au>)
Список pgsql-general
Jamie Deppeler wrote:
> Hi,
>
> having a small problem in a trigger i want to automatically update a
> date field but when i use for example
>
> update table
> set field = current_date
> where table.pk = new.pk

If "table" is the table with the trigger on it, you'll end up with an
endless loop, since the trigger will keep firing itself.

In a BEFORE trigger, just update NEW and make sure you return NEW. Look
at the example in the manual for details.

--
   Richard Huxton
   Archonet Ltd

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