row() is [not] null infelicities

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: row() is [not] null infelicities
Date: 2006-07-10 03:26:21
Message-ID: 87r70ujg2q.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


The SQL spec has some detailed discussion of some strange null behaviours.

Specifically "row(1,null) is null" is false but "row(1,null) is not null" is
*also* supposed to be false. Postgres currently gets this wrong. "is [not]
null" is apparently supposed to mean "all the fields are (not) null".

So in the following the first query is correct but the second is incorrect:

pgbench=# select row(1::integer, null::integer) is null;
?column?
----------
f
(1 row)

pgbench=# select row(1::integer, null::integer) is not null;
?column?
----------
t
(1 row)

--
greg

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2006-07-10 03:31:04 Re: row() is [not] null infelicities
Previous Message Michael Fuhr 2006-07-10 03:13:43 cursors, current_user, and SECURITY DEFINER