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

Re: FW: "=" operator vs. "IS"

From: Stefan Weiss <spaceman(at)foo(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: FW: "=" operator vs. "IS"
Date: 2004-06-28 23:02:24
Message-ID: 200406290102.24885.spaceman@foo.at (view raw or flat)
Thread:
Lists: pgsql-sql
Re,

thanks for all the replies.

On Tuesday, 29 June 2004 00:17, Dmitri Bichko wrote:
> 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.

Sorry, I must have remembered that incorrectly, or maybe I've been
thinking of a different DBMS or version. "table.col = TRUE" seems to
work fine for me now.

I understand that the result of "(anything) = NULL" will always NULL,
so it's a waste of breath. That's where the "IS" operator(?) comes in,
which allows for comparison with NULL. The only question left is why
"IS" can also be used to compare with the TRUE/FALSE keywords (when a
simple "=" should be sufficient here), but not to compare two boolean
columns.


cheers,
stefan


BTW, I really liked Mike's explanation that "it just IS" ;-)

In response to

Responses

pgsql-sql by date

Next:From: Stephan SzaboDate: 2004-06-28 23:24:24
Subject: Re: FW: "=" operator vs. "IS"
Previous:From: terryDate: 2004-06-28 23:00:13
Subject: Re: "=" operator vs. "IS"

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