Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Tom Lane
Daniel CAUNE <[EMAIL PROTECTED]> writes: > How does the IF statement evaluate conditions? Does it evaluate conditions > following their declaration order from left to right? In case of > or-conditions, does the IF statement stop evaluating conditions whenever a > first or-condition is true? > Th

Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Joe
Daniel CAUNE wrote: Hi, How does the IF statement evaluate conditions? Does it evaluate conditions following their declaration order from left to right? In case of or-conditions, does the IF statement stop evaluating conditions whenever a first or-condition is true? Please see 4.2.12. Expr

Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Gregory S. Williamson
Daniel, AFAIK there is no short-circuiting of evaluations in postgres and I don't think you can depend on the order they appear in to determine the order in which they are checked, although more knowledgable people may have better info than I ... so the rewritten form is the way to go. Greg Wi

Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Oisin Glynn
Daniel CAUNE wrote: Hi, How does the IF statement evaluate conditions? Does it evaluate conditions following their declaration order from left to right? In case of or-conditions, does the IF statement stop evaluating conditions whenever a first or-condition is true? The following snippet seem