Skip site navigation (1) Skip section navigation (2)

FW: "=" operator vs. "IS"

From: "Dmitri Bichko" <dbichko(at)genpathpharma(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: FW: "=" operator vs. "IS"
Date: 2004-06-28 22:17:17
Message-ID: 7A4ADADFC8AFF0478D47F63BEDD57CE33A320C@gpmail.gphq.genpathpharma.com (view raw or flat)
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Stefan Weiss
Sent: Monday, June 28, 2004 6:02 PM
To: pgsql-sql(at)postgresql(dot)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

Responses

pgsql-sql by date

Next:From: Steve CrawfordDate: 2004-06-28 22:27:14
Subject: Re: "=" operator vs. "IS"
Previous:From: Stefan WeissDate: 2004-06-28 22:02:29
Subject: "=" operator vs. "IS"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group