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: Empty array IS NULL?
Date: Mon, 28 Jun 2004 09:26:27 -0700
Message-ID: <40E046B3.2070603@joeconway.com> (raw)
In-Reply-To: <1088438514.3239.97.camel@dicaprio.akademie1.de>
References: <1088438514.3239.97.camel@dicaprio.akademie1.de>

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



view thread (6+ messages)  latest in thread

Message-ID: <40E046B3.2070603@joeconway.com>
Permalink:  ../40E046B3.2070603@joeconway.com/
Also on:    postgresql.org/message-id/40E046B3.2070603@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: Empty array IS NULL?
  In-Reply-To: <40E046B3.2070603@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