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

From: Joe Conway <mail(at)joeconway(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Markus Bertheau ☭ <twanger(at)bluetwanger(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp.
Date: 2005-06-06 15:58:28
Message-ID: 42A472A4.6090505@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-06 16:02:11 Re: regexp_replace
Previous Message Joe Conway 2005-06-06 15:50:13 Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

Browse pgsql-patches by date

  From Date Subject
Next Message Jan Wieck 2005-06-06 16:00:36 Re: numeric precision when raising one numeric to another.
Previous Message Joe Conway 2005-06-06 15:50:13 Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2005-06-06 16:09:55 Re: What is faster?
Previous Message Joe Conway 2005-06-06 15:50:13 Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}