how to get the size of array?

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: how to get the size of array?
Date: 2006-03-14 20:48:55
Message-ID: 44172C37.90804@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

Is there a way that I can get the size of one array ?

For example, create table test (id varchar[]);
insert into test values('{}');
insert into test values('{1, 2, 3}');

I am looking for something like :
select sizeOf(id) as size from test;

so that I can get results like:
size
-------
0
3

Thanks a lot,
Ying

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2006-03-14 20:54:27 Re: how to get the size of array?
Previous Message george young 2006-03-14 17:40:59 Re: Copying a row within table