Re: array_dims array_lower/upper distance - Mailing list pgsql-general

From Greg Stark
Subject Re: array_dims array_lower/upper distance
Date
Msg-id 87zmq5kq8h.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: array_dims array_lower/upper distance  (Guy Fraser <guy@incentre.net>)
Responses Re: array_dims array_lower/upper distance
List pgsql-general
Guy Fraser <guy@incentre.net> writes:

> So to answer his question he would likely want :
>
> SELECT
>  array_upper(item,1) - array_upper(item,0) + 1 as elements
> FROM
>  arraytest ;

Note that this doesn't work for empty arrays.
It will return NULL instead of 0.


--
greg

pgsql-general by date:

Previous
From: Tony Wasson
Date:
Subject: Re: Network Flow Schema + Bulk Import/Updates
Next
From: Rafael Martinez
Date:
Subject: Lines of code in PG 8.0 & 8.1?