pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Bertheau <twanger@bluetwanger.de>
To: pgsql-sql@postgresql.org
Subject: Empty array IS NULL?
Date: Mon, 28 Jun 2004 18:01:54 +0200
Message-ID: <1088438514.3239.97.camel@dicaprio.akademie1.de> (raw)

Hi,

is the empty array representable in PostgreSQL, and is it
distinguishable from NULL?

oocms=# SELECT ARRAY[1, 2];
 array
-------
 {1,2}
(1 запись)
 
oocms=# SELECT '{1, 2}'::INT[];
 int4
-------
 {1,2}
(1 запись)
 
oocms=# SELECT ARRAY[];
ERROR:  syntax error at or near "]" at character 14
oocms=# SELECT '{}'::INT[];
 int4
------
 {}
(1 запись)
 
oocms=# SELECT ARRAY(SELECT 1 UNION SELECT 2);
 ?column?
----------
 {1,2}
(1 запись)
 
oocms=# SELECT ARRAY(SELECT 1 WHERE FALSE);
 ?column?
----------
  
(1 запись)
 

-- 
Markus Bertheau <twanger@bluetwanger.de>




view thread (6+ messages)  latest in thread

Message-ID: <1088438514.3239.97.camel@dicaprio.akademie1.de>
Permalink:  ../1088438514.3239.97.camel@dicaprio.akademie1.de/
Also on:    postgresql.org/message-id/1088438514.3239.97.camel@dicaprio.akademie1.de

 · 

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: twanger@bluetwanger.de
  Subject: Re: Empty array IS NULL?
  In-Reply-To: <1088438514.3239.97.camel@dicaprio.akademie1.de>

* 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