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

From Richard Huxton
Subject Re: NULLS and User Input WAS Re: multimaster
Date
Msg-id 466423C9.7030600@archonet.com
Whole thread Raw
In response to Re: NULLS and User Input WAS Re: multimaster  (Andrew Sullivan <ajs@crankycanuck.ca>)
Responses Re: NULLS and User Input WAS Re: multimaster
Re: NULLS and User Input WAS Re: multimaster
List pgsql-general
Andrew Sullivan wrote:
> 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).

Well, a strict "unknown" is fine - so long as it means just that.
   How tall is Andrew? Unknown
   How tall is Richard? Unknown
   Are Andrew and Richard the same height? Unknown

The problem is the slippery-slope from "unknown" to "not applicable" to
"user refused to answer" to ...whatever


Part of it is the poor support for out-of-band values. In many cases
what people want is the ability to have a value of type 'number in range
1-20 or text "n/a"' and there's not a simple way to provide that, so
they use null.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Madison Kelly
Date:
Subject: Re: High-availability
Next
From: Greg Smith
Date:
Subject: Re: NULLS and User Input WAS Re: multimaster