Re: array size

From: akp geek <akpgeek(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: array size
Date: 2011-02-25 14:47:32
Message-ID: AANLkTi=vDzBPDActeGyQzr25_w04L+T_tiqZrgpGjdSU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Unfortunately the our database is still 8.3. that's a limitation for using
array_length

Regards

On Thu, Feb 24, 2011 at 4:08 PM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:

> Hey,
>
> 2011/2/24 akp geek <akpgeek(at)gmail(dot)com>
>
> Hi all -
>>
>> I am trying to find the number of elements in the array.
>> Right now I am using array_upper and array_lower. Is there any other way of
>> getting the number of elements?
>>
> You may use array_length() function, e.g.
> dmitigr=> SELECT array_length(ARRAY[ARRAY[1,2,3],ARRAY[4,5,6]], 1);
> array_length
> --------------
> 2
> (1 row)
>
> dmitigr=> SELECT array_length(ARRAY[ARRAY[1,2,3],ARRAY[4,5,6]], 2);
> array_length
> --------------
> 3
> (1 row)
>
> See http://www.postgresql.org/docs/9.0/static/functions-array.html
>
>>
>> thanks for the help
>>
>> Regards
>>
>
>
>
> --
> // Dmitriy.
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2011-02-25 14:50:13 Re: select to_timestamp('02/26/2011 14:50', 'MM/DD/YYYY HH24MI')
Previous Message Reid Thompson 2011-02-25 14:41:54 Re: select to_timestamp('02/26/2011 14:50', 'MM/DD/YYYY HH24MI')