Re: feature request ?

From: sad <sad(at)bankir(dot)ru>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: feature request ?
Date: 2004-06-24 04:56:50
Message-ID: 200406240856.50292.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message sad 2004-06-24 05:01:21 Re: feature request ?
Previous Message Zoltan Boszormenyi 2004-06-23 19:44:15 OUTER JOIN problem