Re: Pgsql conditions do not short circuit?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Pgsql conditions do not short circuit?
Дата
Msg-id 200502110248.41720.peter_e@gmx.net
обсуждение исходный текст
Ответ на Pgsql conditions do not short circuit?  ("Guy Rouillier" <guyr@masergy.com>)
Список pgsql-interfaces
Guy Rouillier wrote:
> I have the following condition in a trigger function:
>
>   IF (TG_OP = 'INSERT') OR (TG_OP = 'UPDATE' AND NEW.aggregate_flag
> != OLD.aggregate_flag)
>
> When I cause this trigger to execute on an insert, it complains that
> OLD is not defined yet.  If I reformat this so I check the last
> condition in an IF nested in the "UPDATE" case, it works fine.  From
> this, I'm concluding that pgsql conditions do not short circuit?

That is true, but it wouldn't have helped you anyway, because the error 
is caught during the semantic analysis before the execution phase.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


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

Предыдущее
От: "Guy Rouillier"
Дата:
Сообщение: Pgsql conditions do not short circuit?
Следующее
От: "Guy Rouillier"
Дата:
Сообщение: Re: Pgsql conditions do not short circuit?