Re: Trigger plpgsql function, how to test if OLD is set?

Поиск
Список
Период
Сортировка
От Jeff Kowalczyk
Тема Re: Trigger plpgsql function, how to test if OLD is set?
Дата
Msg-id pan.2003.12.04.19.24.29.112299@yahoo.com
обсуждение исходный текст
Ответ на Trigger plpgsql function, how to test if OLD is set?  (Jeff Kowalczyk <jtk@yahoo.com>)
Список pgsql-sql
Tomasz Myrta wrote:
> You can always check whether your trigger has been fired as insert or 
> update trigger.
> DECLARE old_orderid  integer;
> BEGIN
>    if TG_OP=''UPDATE'' then
>       old_orderid=OLD.orderid;
>    else
>       old_orderid=-1;
>    end if;

Thank you, that works well enough. I'm beginning to appreciate the
complexity of working with both the familiar DRI (contraints) and
triggers, which are something I have rarely used.



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

Предыдущее
От: Tomasz Myrta
Дата:
Сообщение: Re: Trigger plpgsql function, how to test if OLD is set?
Следующее
От: Andre Yoshiaki Kashiwabara
Дата:
Сообщение: ECPG and User-defined Types.