Re: Empty array IS NULL?

From: Joe Conway <mail(at)joeconway(dot)com>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Empty array IS NULL?
Date: 2004-06-28 16:26:27
Message-ID: 40E046B3.2070603@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Franco Bruno Borghesi 2004-06-28 16:30:16 Re: Need indexes on inherited tables?
Previous Message Markus Bertheau 2004-06-28 16:01:54 Empty array IS NULL?