Re: ARRAY() returning NULL instead of ARRAY[] resp. {} - Mailing list pgsql-sql

From Joe Conway
Subject Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Date
Msg-id 42923762.7010708@joeconway.com
Whole thread Raw
In response to ARRAY() returning NULL instead of ARRAY[] resp. {}  (Markus Bertheau <twanger@bluetwanger.de>)
Responses Re: ARRAY() returning NULL instead of ARRAY[] resp. {}  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: ARRAY() returning NULL instead of ARRAY[] resp. {}  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-sql
Markus Bertheau wrote:
> why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of
> ARRAY[] resp. '{}'?
> 

Why would you expect an empty array instead of a NULL? NULL is what 
you'd get for other data types -- for example:

regression=# SELECT (SELECT 1 WHERE FALSE) IS NULL; ?column?
---------- t
(1 row)

Joe


pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Next
From: Tom Lane
Date:
Subject: Re: ARRAY() returning NULL instead of ARRAY[] resp. {}