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