Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group