Re: When is a record NULL?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: 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:52:18
Message-ID: 27AF328C-D3F5-4D65-9BBE-EDCD39E9291C@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jul 23, 2009, at 6:06 PM, Jeff Davis wrote:

> However, in step 2, you transformed:
> x IS NOT NULL => NOT x IS NULL
>
> But in SQL that is not a tautology!

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.

> I don't think it's wise to assume SQL is consistent. I think it is
> possible to create a consistent 3VL system, but you have to give up
> some
> other very important property. I can't remember the details at the
> moment, but there's an interesting proof in "Logic and Databases" by
> C.J. Date.

If the standard says that, in the case of records, two NULLs are
distinct, then fine. Completely bizarre, but fine. But I suspect that
such is not the case.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-07-24 01:58:18 Re: When is a record NULL?
Previous Message David E. Wheeler 2009-07-24 01:46:25 Re: When is a record NULL?