Re: ARRAY() returning NULL instead of ARRAY[] resp. {}

From: "Jan B(dot)" <jan(at)monso(dot)de>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Date: 2005-05-23 18:54:07
Message-ID: 429226CF.4090207@monso.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql

Markus Bertheau wrote:
> Hi,
>
> why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of
> ARRAY[] resp. '{}'?
>
> Markus
>

Perhaps Arrays always have to contain at least one element? (I don't
know for sure.)

SELECT array[];
ERROR: syntax error at or near "]" at character 14
LINE 1: SELECT array[];

SELECT array[1];
array
-------
{1}
(1 row)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Bertheau 2005-05-23 18:58:11 Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Previous Message Markus Bertheau 2005-05-23 18:33:39 ARRAY() returning NULL instead of ARRAY[] resp. {}

Browse pgsql-patches by date

  From Date Subject
Next Message Markus Bertheau 2005-05-23 18:58:11 Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Previous Message Markus Bertheau 2005-05-23 18:33:39 ARRAY() returning NULL instead of ARRAY[] resp. {}

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Bertheau 2005-05-23 18:58:11 Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Previous Message Markus Bertheau 2005-05-23 18:33:39 ARRAY() returning NULL instead of ARRAY[] resp. {}