Re: Empty Updates, ON UPDATE triggers and Rules

Поиск
Список
Период
Сортировка
От Josh Trutwin
Тема Re: Empty Updates, ON UPDATE triggers and Rules
Дата
Msg-id 20090806140752.3b769783@sinkhole
обсуждение исходный текст
Ответ на Re: Empty Updates, ON UPDATE triggers and Rules  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
On Thu, 6 Aug 2009 13:15:57 -0400
Merlin Moncure <mmoncure@gmail.com> wrote:

> CREATE OR REPLACE FUNCTION set_last_modified ()
> RETURNS TRIGGER
> AS $$
> BEGIN
>   IF NEW != OLD THEN  -- 8.4 syntax
>     NEW.last_modified = NOW();
>   END IF;
>
>   RETURN NEW;
> END;
> $$ LANGUAGE PLPGSQL;

Thanks - I'll try this.  Since using 8.3 sounds like I need to
replace above with:

IF old::text != new::text

?

I'll give it a go anyway....

Josh

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: What happens when syslog gets blocked?
Следующее
От: Josh Trutwin
Дата:
Сообщение: Re: Empty Updates, ON UPDATE triggers and Rules