Re: Arrays - Mailing list pgsql-general

From Fabrízio de Royes Mello
Subject Re: Arrays
Date
Msg-id CAFcNs+oY_D5LM5B+Kn+jG_+Skf8Wzj3eaQM5X-cb=XPEg-MnYA@mail.gmail.com
Whole thread Raw
In response to Arrays  ("Bob Pawley" <rjpawley@shaw.ca>)
Responses Re: Arrays
List pgsql-general

2011/9/14 Bob Pawley <rjpawley@shaw.ca>
Hi
 
Is there a method of counting the number of elements in an array??
 

Yes...

Use function array_upper [1].

See an example:

postgres@bdteste=# SELECT array_upper(ARRAY['foo', 'bar'], 1);
 array_upper 
-------------
           2
(1 row)


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com

pgsql-general by date:

Previous
From: "Bob Pawley"
Date:
Subject: Arrays
Next
From: Merlin Moncure
Date:
Subject: Re: Arrays