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

From Brendan Jurd
Subject Re: When is a record NULL?
Date
Msg-id 37ed240d0907232134g7cdd4139l19a79d81f8c98666@mail.gmail.com
Whole thread Raw
In response to Re: When is a record NULL?  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: When is a record NULL?  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers
2009/7/24 David E. Wheeler <david@kineticode.com>:
> ROW(1, NULL) is neither NULL nor NOT NULL. I've no idea what state it is,
> but I guess that's the standard.

Well, a ROW is an ordered set of values, each one of which may be
either NULL or NOT NULL.

It doesn't really make sense to talk about the ROW itself being NULL
or NOT NULL, only its member values (but for extra confusion, contrast
with the treatment of arrays, which can themselves be NULL).

It does make sense, however, to talk about the ROW's member values
being entirely NULL or entirely NOT NULL, and that's what the IS NULL
and IS NOT NULL tests tell you about.

I guess the spec authors figured they might as well make IS [NOT] NULL
do something useful when applied to a row rather than throwing an
error.  I tend to agree.

I hope that provides some clarity.

Cheers,
BJ


pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Determining client_encoding from client locale
Next
From: Ms swati chande
Date:
Subject: GeQo Pool Size and plan worth