Re: NULLS and <> : Discrepancies ?

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: "Emmanuel Charpentier,,," <charpent(at)bacbuc(dot)dyndns(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: NULLS and <> : Discrepancies ?
Date: 2000-12-29 22:56:32
Message-ID: 3A4D16A0.6B3ADD6A@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Could someone explain to me why not eliminating nulls destroys the
> potential results of the query ? In other words, for any X not null, X
> not in (some NULLs) is false.

You already know the answer: comparisons to NULL always evaluate to
false. You may conclude that this exposes a flaw in SQL9x's definition
of three-value logic, but is the result you should expect for a
standards-compliant SQL implementation.

- Thomas

(I was going to say "almost always" rather than "always" but I'm not
recalling a counter example and don't have time to look it up. Sorry
about that... ;)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-12-29 23:43:38 Re: GNU readline and BSD license
Previous Message Tom Lane 2000-12-29 22:41:25 Regress-test failure in current sources