From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Stefan Weiss <spaceman@foo.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: FW: "=" operator vs. "IS"
Date: Mon, 28 Jun 2004 16:24:24 -0700 (PDT)
Message-ID: <20040628161747.C38283@megazone.bigpanda.com> (raw)
In-Reply-To: <200406290102.24885.spaceman@foo.at>
References: <7A4ADADFC8AFF0478D47F63BEDD57CE33A320C@gpmail.gphq.genpathpharma.com>
<200406290102.24885.spaceman@foo.at>
On Tue, 29 Jun 2004, Stefan Weiss wrote:
> 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.
IS TRUE and IS FALSE have a different effect from =true and =false when
the left hand side is NULL. The former will return false, the latter will
return NULL.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone.bigpanda.com, spaceman@foo.at
Subject: Re: FW: "=" operator vs. "IS"
In-Reply-To: <20040628161747.C38283@megazone.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox