Howto determin the number of elemnts of an array

Started by Együd Csabaabout 21 years ago7 messagesgeneral
Jump to latest
#1Együd Csaba
csegyud@vnet.hu

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

--
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 reply to: Együd Csaba (#1)
Re: 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

#3Együd Csaba
csegyud@vnet.hu
In reply to: Sven Willenberger (#2)
Re: Howto determin the number of elemnts of an array

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@dmv.com]
Sent: Monday, January 31, 2005 4:27 PM
To: pgsql-general@postgresql.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.

#4Pierre-Frédéric Caillaud
lists@boutiquenumerique.com
In reply to: Együd Csaba (#3)
Re: Howto determin the number of elemnts of an array

icount( array )

Show quoted text

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@dmv.com]
Sent: Monday, January 31, 2005 4:27 PM
To: pgsql-general@postgresql.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

#5Együd Csaba
csegyud@vnet.hu
In reply to: Pierre-Frédéric Caillaud (#4)
Re: Howto determin the number of elemnts of an array

Hi,
this function is part of GiST which is not installed on my server. Should I
install the whole GiST or there is a single package to implement only this
feature?

thank you,
-- Csaba

-----Original Message-----
From: PFC [mailto:lists@boutiquenumerique.com]
Sent: Monday, January 31, 2005 5:16 PM
To: Együd Csaba; 'Sven Willenberger'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Howto determin the number of elemnts of an array

icount( array )

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@dmv.com]
Sent: Monday, January 31, 2005 4:27 PM
To: pgsql-general@postgresql.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.

#6Pierre-Frédéric Caillaud
lists@boutiquenumerique.com
In reply to: Együd Csaba (#5)
Re: Howto determin the number of elemnts of an array

contrib/intarray

On Mon, 31 Jan 2005 20:00:06 +0100, Egyᅵd Csaba <csegyud@vnet.hu> wrote:

Show quoted text

Hi,
this function is part of GiST which is not installed on my server.
Should I
install the whole GiST or there is a single package to implement only
this
feature?

thank you,
-- Csaba

-----Original Message-----
From: PFC [mailto:lists@boutiquenumerique.com]
Sent: Monday, January 31, 2005 5:16 PM
To: Egyᅵd Csaba; 'Sven Willenberger'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Howto determin the number of elemnts of an array

icount( array )

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@dmv.com]
Sent: Monday, January 31, 2005 4:27 PM
To: pgsql-general@postgresql.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

#7Együd Csaba
csegyud@vnet.hu
In reply to: Pierre-Frédéric Caillaud (#6)
Re: Howto determin the number of elemnts of an array

I really can't find such file in contrib dir. Nor files containing 'icount'
pattern. Sorry.
I use Pg8.0 final on windows XP.

On the http://www.sai.msu.su/~megera/postgres/gist/ url I can find only a
patch. Where can I download the whole package from?

Thank you.

-- Csaba

-----Original Message-----
From: PFC [mailto:lists@boutiquenumerique.com]
Sent: Monday, January 31, 2005 8:48 PM
To: Együd Csaba; 'Sven Willenberger'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Howto determin the number of elemnts of an array

contrib/intarray

On Mon, 31 Jan 2005 20:00:06 +0100, Együd Csaba <csegyud@vnet.hu> wrote:

Hi,
this function is part of GiST which is not installed on my server.
Should I
install the whole GiST or there is a single package to implement only
this feature?

thank you,
-- Csaba

-----Original Message-----
From: PFC [mailto:lists@boutiquenumerique.com]
Sent: Monday, January 31, 2005 5:16 PM
To: Együd Csaba; 'Sven Willenberger'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Howto determin the number of elemnts of an
array

icount( array )

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@dmv.com]
Sent: Monday, January 31, 2005 4:27 PM
To: pgsql-general@postgresql.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.