Skip site navigation (1) Skip section navigation (2)

Re: Nulls, arrays, records, IS NULL, IS DISTINCT FROM

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Nulls, arrays, records, IS NULL, IS DISTINCT FROM
Date: 2006-09-29 17:24:15
Message-ID: 17789.1159550655@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
David Fetter <david(at)fetter(dot)org> writes:
> On Fri, Sep 29, 2006 at 12:53:19PM -0400, Tom Lane wrote:
>> In particular, the spec says
>>	ROW(1,2,NULL) IS NOT NULL
>> is false, because the row fields must be *all* not null to make it true.

> That's odd because as I understand the above,
>     ROW(1,2,NULL) IS NULL
> is also false.  Have I misunderstood?

Yup, they are both false.  The spec goes to some trouble to make it
clear that IS NULL/IS NOT NULL are not inverses for row values:

            NOTE 135 - For all R, "R IS NOT NULL" has the same result as
            "NOT R IS NULL" if and only if R is of degree 1. Table 16,
            "<null predicate> semantics", specifies this behavior.

What I find odd is the lack of comparable language about arrays.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-09-29 17:32:44
Subject: Re: a little doubr about domains and pl/python
Previous:From: Paul B. AndersonDate: 2006-09-29 17:08:15
Subject: Re: Array assignment behavior (was Re: Stored procedure array

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group