pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: pgsql-hackers@postgresql.org
Cc: Markus Bertheau ☭ <twanger@bluetwanger.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp.
Date: Mon, 06 Jun 2005 08:58:28 -0700
Message-ID: <42A472A4.6090505@joeconway.com> (raw)
In-Reply-To: <42A470B5.8060007@joeconway.com>
References: <1116873219.7306.0.camel@localhost.localdomain>
	<42923762.7010708@joeconway.com>
	<16774.1116907560@sss.pgh.pa.us>
	<1118067445.5506.6.camel@dicaprio.akademie1.de>
	<25974.1118069089@sss.pgh.pa.us>
	<1118069699.5506.9.camel@dicaprio.akademie1.de>
	<42A470B5.8060007@joeconway.com>

Joe Conway wrote:
> Actually, consistent with my last post, I think array_upper() on a 
> zero-element array should return NULL. A zero-element array has a 
> defined lower bound, but its upper bound is not zero -- it is really 
> undefined.

Just to clarify my response, this is what I propose:

regression=# select array_upper('[2][1:]={{},{}}'::int[],1);
  array_upper
-------------
            2
(1 row)

regression=# select array_upper('[2][1:]={{},{}}'::int[],2) IS NULL;
  ?column?
----------
  t
(1 row)


Joe



view thread (22+ messages)  latest in thread

Message-ID: <42A472A4.6090505@joeconway.com>
Permalink:  ../42A472A4.6090505@joeconway.com/
Also on:    postgresql.org/message-id/42A472A4.6090505@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, pgsql-hackers@postgresql.org, twanger@bluetwanger.de, tgl@sss.pgh.pa.us
  Subject: Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp.
  In-Reply-To: <42A472A4.6090505@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