Re: NULLS and User Input WAS Re: multimaster - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: NULLS and User Input WAS Re: multimaster
Date
Msg-id 20070604140823.GL32320@phlogiston.dyndns.org
Whole thread Raw
In response to Re: NULLS and User Input WAS Re: multimaster  (PFC <lists@peufeu.com>)
Responses Re: NULLS and User Input WAS Re: multimaster
Re: NULLS and User Input WAS Re: multimaster
Re: NULLS and User Input WAS Re: multimaster
List pgsql-general
On Mon, Jun 04, 2007 at 12:37:42AM +0200, PFC wrote:
> NULL usually means "unknown" or "not applicable"

Aaaargh!  No, it doesn't.  It means NULL.  Nothing else.

If it meant unknown or not applicable or anything else, then

    SELECT * FROM nulltbl a, othernulltbl b
        WHERE a.nullcol = b.nullcol

would return rows where a.nullcol contained NULL and b.nullcol
contained NULL.  But it doesn't, because !(NULL = NULL).

It's too bad indeed that the originators of SQL used three-value
rather than five-value logic, but this is what we have.  If you
happen to want to use NULL to mean something specific in some
context, go ahead, but you shouldn't generalise that to "usually
means" anything.

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
Everything that happens in the world happens at some place.
        --Jane Jacobs

pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [Re] Re: Winsock error 10035 while trying to upgrade from 8.0 to 8.2
Next
From: Chander Ganesan
Date:
Subject: Re: High-availability