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 F165AD1B1D9 for ; Thu, 24 Jun 2004 02:32:59 -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 15685-08 for ; Thu, 24 Jun 2004 05:32:58 +0000 (GMT) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by svr1.postgresql.org (Postfix) with ESMTP id 895D4D1B75C for ; Thu, 24 Jun 2004 02:32:55 -0300 (ADT) Received: from [10.10.14.130] glaesema [61.115.206.98] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.87 $ on Novell NetWare; Wed, 23 Jun 2004 23:32:47 -0600 In-Reply-To: <200406231012.36791.josh@agliodbs.com> References: <200406231355.50079.sad@bankir.ru> <200406231012.36791.josh@agliodbs.com> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: sad , pgsql-sql@postgresql.org From: Michael Glaesemann Subject: Re: feature request ? Date: Thu, 24 Jun 2004 14:32:22 +0900 To: Josh Berkus X-Mailer: Apple Mail (2.618) 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/220 X-Sequence-Number: 18165 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; Michael Glaesemann grzm myrealbox com