Re: When is a record NULL?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: When is a record NULL?
Date: 2009-07-23 22:29:24
Message-ID: AD0542DC-FC37-40A1-8450-38EE82B37892@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jul 23, 2009, at 3:19 PM, David E. Wheeler wrote:

> How can a record be neither NULL or NOT NULL?
>
> try=# select ROW(1, NULL) IS NULL;
> ?column?
> ----------
> f
> (1 row)
>
> try=# select ROW(1, NULL) IS NOT NULL;
> ?column?
> ----------
> f
> (1 row)
>
> This makes it rather hard to tell, in PL/pgSQL, when I've fetched
> the last record from a cursor…

Also:

select ROW(1, NULL) IS DISTINCT FROM ROW(2, NULL);
?column?
----------
t

As expected, but the IS NULL above is not expected (by this bunny,
anyway).

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-07-23 22:33:19 Re: When is a record NULL?
Previous Message James Pye 2009-07-23 22:23:40 WIP: plpython3