Empty array IS NULL? - Mailing list pgsql-sql

From Markus Bertheau
Subject Empty array IS NULL?
Date
Msg-id 1088438514.3239.97.camel@dicaprio.akademie1.de
Whole thread Raw
Responses Re: Empty array IS NULL?
Re: Empty array IS NULL?
List pgsql-sql
Hi,

is the empty array representable in PostgreSQL, and is it
distinguishable from NULL?

oocms=# SELECT ARRAY[1, 2];array
-------{1,2}
(1 запись)
oocms=# SELECT '{1, 2}'::INT[];int4
-------{1,2}
(1 запись)
oocms=# SELECT ARRAY[];
ERROR:  syntax error at or near "]" at character 14
oocms=# SELECT '{}'::INT[];int4
------{}
(1 запись)
oocms=# SELECT ARRAY(SELECT 1 UNION SELECT 2);?column?
----------{1,2}
(1 запись)
oocms=# SELECT ARRAY(SELECT 1 WHERE FALSE);?column?
----------
(1 запись)

--
Markus Bertheau <twanger@bluetwanger.de>



pgsql-sql by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Need indexes on inherited tables?
Next
From: Joe Conway
Date:
Subject: Re: Empty array IS NULL?