FW: "=" operator vs. "IS" - Mailing list pgsql-sql

From Dmitri Bichko
Subject FW: "=" operator vs. "IS"
Date
Msg-id 7A4ADADFC8AFF0478D47F63BEDD57CE33A320C@gpmail.gphq.genpathpharma.com
Whole thread Raw
Responses Re: FW: "=" operator vs. "IS"  (Stefan Weiss <spaceman@foo.at>)
Re: FW: "=" operator vs. "IS"  (Rich Hall <rhall@micropat.com>)
Re: FW: "=" operator vs. "IS"  (Jeff Boes <jboes@qtm.net>)
List pgsql-sql
You are exactly right - the way I think about it is that if you have two
values which are unknown (a null column and NULL) it does not follow
that they are equal to each other.

As far as TRUE and FALSE go, from what I know you can use = to compare
them with boolean columns, unless I misunderstood your question.

Dmitri

-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Stefan Weiss
Sent: Monday, June 28, 2004 6:02 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] "=" operator vs. "IS"


Hi.

I'm just curious - why is it not possible to use the "=" operator to
compare values with NULL? I suspect that the SQL standard specified it
that way, but I can't see any ambiguity in an expression like "AND
foo.bar = NULL". Is it because NULL does not "equal" any value, and the
expression should be read as "foo.bar is unknown"? Or is there something
else I'm missing?

If it's the "unknown" part, then why can't I use "=" to compare with
TRUE or FALSE?


cheers,
stefan

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


pgsql-sql by date:

Previous
From: Stefan Weiss
Date:
Subject: "=" operator vs. "IS"
Next
From: Steve Crawford
Date:
Subject: Re: "=" operator vs. "IS"