wierd AND condition evaluation for plpgsql

From: Louis-David Mitterrand <vindex(at)apartia(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: wierd AND condition evaluation for plpgsql
Date: 2002-05-28 07:20:42
Message-ID: 20020528072042.GA7165@apartia.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2002-05-28 07:37:29 Re: strange update problem with 7.2.1
Previous Message Joe Conway 2002-05-28 06:15:00 Re: SRF rescan testing