Re: Howto determin the number of elemnts of an array

From: Együd Csaba <csegyud(at)vnet(dot)hu>
To: 'Sven Willenberger' <sven(at)dmv(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Howto determin the number of elemnts of an array
Date: 2005-01-31 15:30:12
Message-ID: 0IB6006C5TXAQV@mail.vnet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Seven,
it would be better for me if it returned the number of elements as an
integer even if the array is empty (in this case it returns with NULL). No
metter this is easily can be worked around, but it would have been more
confortable.

Thank you very much.
-- Csaba Együd

-----Original Message-----
From: Sven Willenberger [mailto:sven(at)dmv(dot)com]
Sent: Monday, January 31, 2005 4:27 PM
To: pgsql-general(at)postgresql(dot)org
Cc: Együd Csaba
Subject: Re: [GENERAL] Howto determin the number of elemnts of an array

Együd Csaba wrote:
> Hi,
> how can I determin the number of elements of an array? I saw function
> array_dims() which returns a string value representing the dimensions
> of the array. Is there a function which returns only the number of
> elements as an integer.
>
> -- Csaba
>

array_upper(arrayname,dimension) will return the number of elements in the
specified dimension of array arrayname.

Sven

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.2 - Release Date: 2005.01.28.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sven Willenberger 2005-01-31 15:33:28 Dereferencing a 2-dimensional array in plpgsql
Previous Message Alban Hertroys 2005-01-31 15:28:24 Re: postgres session termination