Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-24 Thread Tom Lane
wstrzalka <[EMAIL PROTECTED]> writes: > So - does it mean that the whole IF-ELSE-ENDIF is not parsed at once - > but lazy-parsed when the control reaches it, while the IF condition is > parsed as a single expression and therefore I get error in this case? Right, for a suitable definition of "parse

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread wstrzalka
On 23 Kwi, 16:32, [EMAIL PROTECTED] (Tom Lane) wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I think this business of non-shortcircuiting boolean operators is just > > an artifact of the fact that PL/pgSQL hands off expression to the SQL > > engine for evaluation. > > The complainant is n

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I think this business of non-shortcircuiting boolean operators is just > an artifact of the fact that PL/pgSQL hands off expression to the SQL > engine for evaluation. The complainant is not actually complaining about non-shortcircuiting boolean operato

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Alvaro Herrera
Martijn van Oosterhout escribió: > On Tue, Apr 22, 2008 at 02:41:50AM -0700, wstrzalka wrote: > > One of the annoying things in plpgsql is logical expression > > evaluation. > > > > In most (all??) languages I know, logical expression like: > > > > if ( [A_true_expression] or [B_false_expres

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Martijn van Oosterhout
On Tue, Apr 22, 2008 at 02:41:50AM -0700, wstrzalka wrote: > One of the annoying things in plpgsql is logical expression > evaluation. > > In most (all??) languages I know, logical expression like: > > if ( [A_true_expression] or [B_false_expression] ) then > > will stop evaluating when the