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 F3C4AD1B1B0 for ; Mon, 28 Jun 2004 19:21:26 -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 60426-10 for ; Mon, 28 Jun 2004 22:21:26 +0000 (GMT) Received: from gpmail.gphq.genpathpharma.com (unknown [12.30.17.20]) by svr1.postgresql.org (Postfix) with ESMTP id 5D336D1B196 for ; Mon, 28 Jun 2004 19:21:21 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message Subject: FW: "=" operator vs. "IS" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 28 Jun 2004 18:17:17 -0400 Message-ID: <7A4ADADFC8AFF0478D47F63BEDD57CE33A320C@gpmail.gphq.genpathpharma.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] "=" operator vs. "IS" Thread-Index: AcRdXNpcWIoOKZmcRxundMuIU1uGqAAADxHQAAAjTbA= From: "Dmitri Bichko" To: 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/279 X-Sequence-Number: 18224 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 =3D 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] "=3D" operator vs. "IS" Hi. I'm just curious - why is it not possible to use the "=3D" 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 =3D 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 "=3D" to compare with TRUE or FALSE? cheers, stefan ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster