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 8C6EED1B489 for ; Fri, 25 Jun 2004 05:33:42 -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 64065-05 for ; Fri, 25 Jun 2004 08:33:37 +0000 (GMT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id E40BCD1B173 for ; Fri, 25 Jun 2004 05:33:34 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1Bdm9L-000EXF-0U; Fri, 25 Jun 2004 09:33:31 +0100 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 22483167B6; Fri, 25 Jun 2004 09:33:30 +0100 (BST) Message-ID: <40DBE35A.70104@archonet.com> Date: Fri, 25 Jun 2004 09:33:30 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: sad Cc: Rosser Schwarz , pgsql-sql@postgresql.org Subject: Re: feature request ? References: <200406250816.47781.sad@bankir.ru> <37d451f70406242237dce4a8e@mail.gmail.com> <200406251020.41387.sad@bankir.ru> In-Reply-To: <200406251020.41387.sad@bankir.ru> 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=LINES_OF_YELLING X-Spam-Level: X-Archive-Number: 200406/252 X-Sequence-Number: 18197 sad wrote: > On Friday 25 June 2004 09:37, Rosser Schwarz wrote: > >>On Fri, 25 Jun 2004 08:16:47 +0400, sad wrote: >> >>>>Very simply, a boolean may have to values: true or false. It's also >>>>possible that it's not been set to anything (NULL). >>> >>>really ? >>>what about (13 < NULL)::BOOL >> >>Per the semantics of NULL, 13 is neither greater than nor less than >>NULL. NULL is the *unknown* value; it's impossible to meaningfully >>compare it to anything else. Try (NULL = NULL)::boolean. It's NULL, >>also. > > > READ THE THREAD BEFORE ANSWER WHAT MAKES YOU THINK HE HASN'T? OH, AND WHY ARE WE SHOUTING? Your main argument seems to be: 1. A boolean value may have 3 states: true/false/null 2. The "if" statement has only if/then/else/endif 3. The "if" statement needs to be expanded to include "elsenull" or similar. Now, you can argue for/against special-casing nulls, but all other languages cope with defined(), isset() etc. tests. The key point of argument, and where the problem is with your (13 < NULL)::BOOL point is this: - Boolean _values_ can have one of two states: true/false - Boolean _variables_ can have one of three states: true/false/null What you had in your example was an undefined boolean variable, not a boolean value with a third state. You can argue that the null in question is of type boolean (I don't), but it is explicitly _not_ a value. Now, your point that: IF (...)=true is not the same as IF NOT((...)=false) is a good one. Handling of NULLs causes a great deal of pain to inexperienced and experienced developers alike. You might be interested in the archives at http://www.dbdebunk.com/ which IIRC contains some articles arguing against nulls at all in a relational system. -- Richard Huxton Archonet Ltd