row() is [not] null infelicities - Mailing list pgsql-hackers

From Greg Stark
Subject row() is [not] null infelicities
Date
Msg-id 87r70ujg2q.fsf@stark.xeocode.com
Whole thread Raw
Responses Re: row() is [not] null infelicities  (Greg Stark <gsstark@mit.edu>)
Re: row() is [not] null infelicities  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: cursors, current_user, and SECURITY DEFINER
Next
From: Greg Stark
Date:
Subject: Re: row() is [not] null infelicities