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 B7AAAD1B75D for ; Thu, 24 Jun 2004 15:22:32 -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 20699-07 for ; Thu, 24 Jun 2004 18:22:32 +0000 (GMT) Received: from mxc.pcnet.ro (unknown [82.137.14.5]) by svr1.postgresql.org (Postfix) with ESMTP id 1C72DD1B74E for ; Thu, 24 Jun 2004 15:22:29 -0300 (ADT) Received: from aldratech.com (aldratech.com.pcnet.ro [213.154.158.58] (may be forged)) by mxc.pcnet.ro (8.12.10/8.12.10) with ESMTP id i5OIMRdW012802 for ; Thu, 24 Jun 2004 21:22:28 +0300 Received: from aldratech.com ([192.168.0.6]) by aldratech.com for with eXtremail; Thu, 24 Jun 2004 21:22:28 +3GMT Message-ID: <40DB1C79.1000307@aldratech.com> Date: Thu, 24 Jun 2004 21:24:57 +0300 From: Radu-Adrian Popescu Reply-To: radu.popescu@aldratech.com Organization: Aldratech Ltd. User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: sad@bankir.ru Subject: Re: feature request ? References: <71E37EF6B7DCC1499CEA0316A256832801057B7C@loki.wc.globexplorer.net> <200406241655.26065.sad@bankir.ru> <20040624065015.Y87012@megazone.bigpanda.com> <200406241724.14810.sad@bankir.ru> <20040624072023.H88508@megazone.bigpanda.com> <20040624174305.GA32506@wolff.to> In-Reply-To: <20040624174305.GA32506@wolff.to> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/238 X-Sequence-Number: 18183 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