X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D83449FA436 for ; Wed, 6 Sep 2006 20:40:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 07606-07-3 for ; Wed, 6 Sep 2006 23:40:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by postgresql.org (Postfix) with ESMTP id 7BAD99FA2D5 for ; Wed, 6 Sep 2006 20:40:24 -0300 (ADT) Received: from [192.168.7.5] ([71.101.67.143]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J5700AVJ32V00M0@vms044.mailsrvcs.net> for pgsql-sql@postgresql.org; Wed, 06 Sep 2006 18:40:08 -0500 (CDT) Date: Wed, 06 Sep 2006 19:40:17 -0400 From: Joe Subject: Re: Evaluation of if conditions In-reply-to: <001601c6d204$5d2cd840$0b00a8c0@tedy> To: Daniel CAUNE Cc: pgsql-sql@postgresql.org Message-id: <44FF5C60.80601@freedomcircle.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <001601c6d204$5d2cd840$0b00a8c0@tedy> User-Agent: Thunderbird 1.5 (X11/20060317) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/42 X-Sequence-Number: 26253 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. Expression Evaluation Rules of the manual: The order of evaluation of subexpressions is not defined. In particular, the inputs of an operator or function are not necessarily evaluated left-to-right or in any other fixed order. There's more examples there too. Joe