pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Markus Bertheau <twanger@bluetwanger.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
Date: Mon, 23 May 2005 13:04:50 -0700
Message-ID: <42923762.7010708@joeconway.com> (raw)
In-Reply-To: <1116873219.7306.0.camel@localhost.localdomain>
References: <1116873219.7306.0.camel@localhost.localdomain>

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

Why would you expect an empty array instead of a NULL? NULL is what 
you'd get for other data types -- for example:

regression=# SELECT (SELECT 1 WHERE FALSE) IS NULL;
  ?column?
----------
  t
(1 row)

Joe



view thread (22+ messages)  latest in thread

Message-ID: <42923762.7010708@joeconway.com>
Permalink:  ../42923762.7010708@joeconway.com/
Also on:    postgresql.org/message-id/42923762.7010708@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mail@joeconway.com, twanger@bluetwanger.de
  Subject: Re: ARRAY() returning NULL instead of ARRAY[] resp. {}
  In-Reply-To: <42923762.7010708@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox