Re: When is a record NULL?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgresql(dot)org>,"Sam Mason" <sam(at)samason(dot)me(dot)uk>
Subject: Re: When is a record NULL?
Date: 2009-07-24 17:30:39
Message-ID: 4A69A96F0200002500028D22@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sam Mason <sam(at)samason(dot)me(dot)uk> wrote:
> On Fri, Jul 24, 2009 at 09:31:13AM -0400, Tom Lane wrote:

> Hope nobody minds if I go off on a somewhat pedagogic bent here!

Not as long as you don't mind replies in kind. ;-)

> The fact that it happens to be a NULL *value* in one case

Well, according to Codd (and I tend to go with him on this) there is
no such thing. NULL is a way to flag a place where a value could be
stored, but is not -- because is unknown or is not applicable in that
context. (He seemed to feel it was a big weakness of SQL that it
didn't differentiate between these two conditions, but that's another
argument.) "NULL value" is an oxymoron.

>> SQL doesn't provide a test for this case that's separate from the
>> test involving null-ness of individual fields. Not much we can do
>> about it though. I'm not entirely sure that exposing the
>> distinction would be helpful anyway ...
>
> I think it would

The distinction between not having a tuple and having a tuple for
which you don't know any applicable values seems thin. I'm not sure
what that would really mean.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-07-24 17:30:42 Re: WIP: Deferrable unique constraints
Previous Message Joshua D. Drake 2009-07-24 17:29:53 Re: WIP: plpython3