Re: Arrays: determining size - Mailing list pgsql-general

From SZUCS Gábor
Subject Re: Arrays: determining size
Date
Msg-id 017601c29a33$5e894820$0a03a8c0@fejleszt2
Whole thread Raw
In response to Arrays: determining size  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: Arrays: determining size
List pgsql-general
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
>


pgsql-general by date:

Previous
From: Joel Burton
Date:
Subject: Re: [SQL] CURRENT_TIMSTAMP
Next
From: "Nicolai Tufar"
Date:
Subject: Re: timing queries?