Re: When is a record NULL? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: When is a record NULL?
Date
Msg-id 25925.1248442273@sss.pgh.pa.us
Whole thread Raw
In response to Re: When is a record NULL?  (Brendan Jurd <direvus@gmail.com>)
Responses Re: When is a record NULL?
Re: When is a record NULL?
List pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> So it is wrong to talk about ROW(NULL, NULL) being NULL.  It doesn't
> have the property of being NULL or not NULL, because it is a composite
> value.  "ROW(NULL, NULL) IS NULL" returns true, but that is not the
> same as saying that it actually is NULL, because of the different
> semantics above.

It's worse than that, because there actually is also such a thing as
the row value being NULL --- ie, there's no row structure at all.
At least internally, that's a completely different thing from having
a row all of whose fields are null.

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 ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Gould
Date:
Subject: Re: When is a record NULL?
Next
From: Tom Lane
Date:
Subject: Re: join regression failure on cygwin