How to count elements in an array? - Mailing list pgsql-sql

From Grant
Subject How to count elements in an array?
Date
Msg-id Pine.LNX.4.21.0103060849160.2044-100000@webster.conprojan.com.au
Whole thread Raw
List pgsql-sql
How can I obtain a count (number) of elements in a text array? Thanks.

test=# \d array                             Table "array" Attribute   |  Type   |                    Modifier
--------------+---------+------------------------------------------------id           | integer | not null default
nextval('array_id_seq'::text)to_group_ids| text[]  |
 
Index: array_pkey

test=#

--- EXAMPLE SELECT ---

test=# select to_group_ids[1] from array where id=1;to_group_ids
--------------1
(1 row)

test=#



pgsql-sql by date:

Previous
From: Mathijs Brands
Date:
Subject: Clustering (was Re: Optimizing Query)
Next
From: Michael Fork
Date:
Subject: Re: Optimizing Query