Skip site navigation (1) Skip section navigation (2)

Re: feature request ?

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: sad <sad(at)bankir(dot)ru>, pgsql-sql(at)postgresql(dot)org
Subject: Re: feature request ?
Date: 2004-06-24 05:32:22
Message-ID: DDFC5701-C59F-11D8-B2C1-000A95C88220@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-sql
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


In response to

Responses

pgsql-sql by date

Next:From: sadDate: 2004-06-24 07:04:15
Subject: Re: feature request ?
Previous:From: sadDate: 2004-06-24 05:01:21
Subject: Re: feature request ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group