Re: array_dims array_lower/upper distance

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Guy Fraser <guy(at)incentre(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: array_dims array_lower/upper distance
Date: 2005-09-22 16:43:26
Message-ID: 87zmq5kq8h.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Guy Fraser <guy(at)incentre(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rafael Martinez 2005-09-22 16:53:06 Lines of code in PG 8.0 & 8.1?
Previous Message Tony Wasson 2005-09-22 16:37:53 Re: Network Flow Schema + Bulk Import/Updates