Steve,
It worked for me in 7.2.1:
select *, array_dims(bar) from foo;
bar | array_dims
-----------+------------
{1,2,3,4} | [1:4]
{a,b,c} | [1:3]
(2 rows)
I think it's two-dimensional; read more in arrays.html in the PostgreSQL
doc.
G.
--
while (!asleep()) sheep++;
---------------------------- cut here ------------------------------
----- Original Message -----
From: "Steve Crawford" <scrawford@pinpointresearch.com>
To: <pgsql-general@postgresql.org>
Sent: Monday, December 02, 2002 6:58 PM
Subject: [GENERAL] Arrays: determining size
> Given a variable length array data type in a table:
> create table foo (bar text[]);
>
> and some data:
> insert into foo values ('{"a","b","c"'});
> insert into foo values ('{"1","2","3","4"}');
>
> Is there a simple way to determe the size of each array?
>
> Cheers,
> Steve
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>