Re: modifying a timestamp in a C trigger

Поиск
Список
Период
Сортировка
От Don Baccus
Тема Re: modifying a timestamp in a C trigger
Дата
Msg-id 3.0.1.32.20000814104519.014554a0@mail.pacifier.com
обсуждение исходный текст
Ответ на modifying a timestamp in a C trigger  (Louis-David Mitterrand <cunctator@apartia.ch>)
Ответы Re: modifying a timestamp in a C trigger  (Louis-David Mitterrand <cunctator@apartia.ch>)
Список pgsql-hackers
At 04:47 PM 8/14/00 +0200, Louis-David Mitterrand wrote:
>Hello,
>
>I just finished a new C trigger that updated a "modified" column with
>the current time upon an UPDATE event. It seems to work OK but I just
>wanted to bounce this off you guys to check for some non-kosher stuff or
>better way of doing it. Thanks in advance.

This could easily done in PL/pgSQL.  Your C trigger will have to be modified
if the details of trigger or the function call protocol changes, while the
PL/pgSQL source will work forever without change.

And since the expense is in the "update" itself, I'd be surprised if you
could measure any speed difference between the two approaches.

Unless you're doing this to learn how to write C triggers for the heck
of it or to do stuff you can't do in PL/pgSQL, the PL/pgSQL approach is
much better.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


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

Предыдущее
От: Louis-David Mitterrand
Дата:
Сообщение: modifying a timestamp in a C trigger
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [GENERAL] +/- Inf for float8's