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

Re: feature request ?

From: Radu-Adrian Popescu <radu(dot)popescu(at)aldratech(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: sad(at)bankir(dot)ru
Subject: Re: feature request ?
Date: 2004-06-24 18:24:57
Message-ID: 40DB1C79.1000307@aldratech.com (view raw or flat)
Thread:
Lists: pgsql-sql
Bruno Wolff III wrote:
> 
> There already is a syntax like this. You can do:
> CASE boolean_expression
>   WHEN TRUE THEN whatever
>   WHEN FALSE THEN whatever
>   ELSE whatever
> END
> 

Besides, sad, there's no such thing as a tri-valued boolean.
You either have a boolean(with a true/false value) or a NULL, which is something 
completely different and it's _not_ one of the two _values_ that a boolean 
object takes. I think you're looking at this completely wrong. If in Java you 
receive a Boolean object instance, will you start claiming that that Java has 
tri-valued booleans, and the "if" should account for that ?!

You can think of values in plpgsql as wrapper objects that carry a value and 
have a "is_null" flag; I have no idea how they're implemented in PostgreSQL or 
in any RDMBS in general but this should do it, at least for a naive implementation.

Peace,
-- 
Radu-Adrian Popescu
CSA, DBA, Developer
Aldrapay MD
Aldratech Ltd.
+40213212243


In response to

Responses

pgsql-sql by date

Next:From: Stephan SzaboDate: 2004-06-24 18:41:42
Subject: Re: feature request ?
Previous:From: Bruno Wolff IIIDate: 2004-06-24 17:43:05
Subject: Re: feature request ?

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