wierd AND condition evaluation for plpgsql

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема wierd AND condition evaluation for plpgsql
Дата
Msg-id 20020528072042.GA7165@apartia.org
обсуждение исходный текст
Ответы Re: wierd AND condition evaluation for plpgsql  ("Joel Burton" <joel@joelburton.com>)
Re: wierd AND condition evaluation for plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: wierd AND condition evaluation for plpgsql  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Hi,

I just noticed plpgsql evaluates all AND'ed conditions even if the first
one fails. Example:
elsif TG_OP = ''UPDATE'' and old.type_reponse = ''abandon''

This will break stuff if the trigger is used on INSERT as
"old.type_reponse" will be substituted and return an error.

Shouldn't plpgsql shortcut AND conditions when a previous one fails, as
perl does?

--    OENONE: Quoi ?   PHEDRE: Je te l'ai prédit, mais tu n'as pas voulu.
(Phèdre,J-B Racine, acte 3, scène 3)
 


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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: revised sample SRF C function; proposed SRF API
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: Replication status