Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. - Mailing list pgsql-hackers

From Joe Conway
Subject Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp.
Date
Msg-id 42A472A4.6090505@joeconway.com
Whole thread Raw
In response to Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}  (Joe Conway <mail@joeconway.com>)
Responses Re: [SQL] ARRAY() returning NULL instead of ARRAY[]
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}
Next
From: Tino Wildenhain
Date:
Subject: Re: PGDN source browser