Re: When is a record NULL?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: David E(dot) Wheeler <david(at)kineticode(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: When is a record NULL?
Date: 2009-07-24 01:58:18
Message-ID: B0B6B859-131A-4D19-94BE-D6EDA552E456@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jul 23, 2009, at 6:52 PM, David E. Wheeler wrote:

> No, that's not the problem I see -- that solved the problem in my
> particular code. The problem I see is that, given that the standard
> says (according to Tom) that if any value is NULL then the record is
> NULL, then I would expect this to return false:
>
> SELECT ROW(1, NULL) IS DISTINCT FROM ROW(2, NULL);
>
> But it returns true.

Sorry, I'm confused. Understandable I think. So:

ROW(1, NULL) is neither NULL nor NOT NULL. I've no idea what state it
is, but I guess that's the standard. In this case, IS DISTINCT FROM
gives me a sensible return value -- it assumes that the records are
NOT NULL, I guess, for its purposes. This is still inconsistent, since
the records are neither NULL nor NOT NULL, but perhaps sensible.

It's pretty insane, frankly. Gotta love SQL.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2009-07-24 02:12:39 Re: Determining client_encoding from client locale
Previous Message David E. Wheeler 2009-07-24 01:52:18 Re: When is a record NULL?