Re: Empty array IS NULL? - Mailing list pgsql-sql

From Joe Conway
Subject Re: Empty array IS NULL?
Date
Msg-id 40E046B3.2070603@joeconway.com
Whole thread Raw
In response to Empty array IS NULL?  (Markus Bertheau <twanger@bluetwanger.de>)
Responses Re: Empty array IS NULL?  (Markus Bertheau <twanger@bluetwanger.de>)
List pgsql-sql
Markus Bertheau wrote:
> is the empty array representable in PostgreSQL, and is it
> distinguishable from NULL?

Yes, and yes.

regression=# select '{}'::int[]; int4
------ {}
(1 row)

regression=# select NULL::int[]; int4
------

(1 row)

Since NULL array elements are not currently supported, attempting to 
construct an array with a NULL element results in NULL, not an empty array.

Joe


pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: Empty array IS NULL?
Next
From: Franco Bruno Borghesi
Date:
Subject: Re: Need indexes on inherited tables?