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>, Brendan Jurd <direvus(at)gmail(dot)com>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: When is a record NULL?
Date: 2009-07-25 23:20:17
Message-ID: 45BA8563-CF9A-40ED-80D5-31A9BB7FBA84@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jul 25, 2009, at 9:24 AM, Jeff Davis wrote:

> I don't think you want the "NOT x IS NULL" part at all -- that will
> evaluate to false when x = rec(NULL,NULL). I think you just want the
> "x
> IS DISTINCT FROM NULL" part, right? Will that work?

Nope, infinite loop when because `ROW(null, null)` and `ROW()` are
both distinct from null:

try=# select row(null, null) is distinct from null, row() is distinct
from null;
?column? | ?column?
----------+----------
t | t
(1 row)

So I still can't tell when I've exhausted a cursor.

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-07-25 23:41:44 Re: When is a record NULL?
Previous Message Tom Lane 2009-07-25 22:40:09 Re: autogenerating headers & bki stuff