X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 343FED1B8EB for ; Thu, 24 Jun 2004 02:49:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23051-09 for ; Thu, 24 Jun 2004 05:49:28 +0000 (GMT) Received: from rock.spider.ru (rock.spider.ru [62.183.34.226]) by svr1.postgresql.org (Postfix) with ESMTP id 0434FD1B7D0 for ; Thu, 24 Jun 2004 02:49:26 -0300 (ADT) Received: from rock (localhost [127.0.0.1]) by rock (Postfix) with SMTP id 180459132A; Thu, 24 Jun 2004 09:49:25 +0400 (MSD) Received: from sad.localnet.ru (sad.localnet.ru [10.0.0.33]) by rock.spider.ru (Postfix) with ESMTP id 4DA019127B; Thu, 24 Jun 2004 09:49:24 +0400 (MSD) Content-Type: text/plain; charset="iso-8859-1" From: sad Organization: IT To: Michael Glaesemann , Josh Berkus Subject: Re: feature request ? Date: Thu, 24 Jun 2004 08:56:50 +0400 User-Agent: KMail/1.4.3 Cc: pgsql-sql@postgresql.org References: <200406231355.50079.sad@bankir.ru> <200406231012.36791.josh@agliodbs.com> In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200406240856.50292.sad@bankir.ru> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/221 X-Sequence-Number: 18166 On Thursday 24 June 2004 09:32, Michael Glaesemann wrote: > On Jun 24, 2004, at 2:12 AM, Josh Berkus wrote: > > Sad, > > > >> since BOOL expression has three possible values: TRUE,FALSE,NULL > >> plpgsql IF control structure should have three alternate blocks: > >> THEN,ELSE,NULL > >> > >> shouldn't it ? > > > > No, why? > > > > How would you construct a tri-valued IF/THEN? Doesn't seem too > > likely to > > me, as well as being different from every other programming language in > > existance ... > > Creating a new control structure to do handle this seems odd. However, > one could easily have the same effect using a nested if. Using the > pl/pgsql ELSIF construct, it's pretty straightforward. > > IF foo IS NULL > THEN ... > ELSIF foo > THEN ... > ELSE ... > END IF; here the foo expression woll be executed twice