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 EC827D1B179 for ; Tue, 29 Jun 2004 11:47:18 -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 06581-04 for ; Tue, 29 Jun 2004 14:47:14 +0000 (GMT) Received: from mailgate3.cinetic.de (mailgate3.cinetic.de [217.72.192.164]) by svr1.postgresql.org (Postfix) with ESMTP id 732C6D1B1B6 for ; Tue, 29 Jun 2004 11:47:08 -0300 (ADT) Received: from exchange2.int.cinetic.de (exchange2.dlan.cinetic.de [172.20.1.112]) by mailgate3.cinetic.de (8.11.6p2/8.11.2/SuSE Linux 8.11.0-0.4) with ESMTP id i5TEl3K30958; Tue, 29 Jun 2004 16:47:03 +0200 Received: from webde-ag.de (lxmkl.int.cinetic.de [10.1.8.177]) by exchange2.int.cinetic.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id NRWHDJCD; Tue, 29 Jun 2004 16:47:03 +0200 Message-ID: <40E180E5.40608@webde-ag.de> Date: Tue, 29 Jun 2004 16:47:01 +0200 From: Michael Kleiser Reply-To: mkl@webde-ag.de Organization: WEB.DE AG User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.3.1) Gecko/20030425 X-Accept-Language: de, de-at, en, en-us MIME-Version: 1.0 To: Rich Hall Cc: pgsql-sql@postgresql.org Subject: Re: FW: "=" operator vs. "IS" References: <40E17C81.3090308@micropat.com> In-Reply-To: <40E17C81.3090308@micropat.com> 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/289 X-Sequence-Number: 18234 NULL is handled like "unknow" When you comparing something with an unknown value, you are not able to say if they are equal or not. So the result is also unknown. The result NULL is correct. If you whant to check if somethings is NULL you have to use "(anything) IS NULL" Rich Hall schrieb: > My question is why is the form > > "(anything) = NULL" > > allowed? > > Since > > "(anything) = NULL" is always Null, this cannot be what the coder > intended. > > This is much different when comparing two variables, where the coder may > have to handle the cases where the variables are Null. Here the > comparison is to a constant. > > > > > Rick > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html