Re: using arrays as variable, not as field

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Fernando Papa" <fpapa(at)claxson(dot)com>
Cc: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: using arrays as variable, not as field
Date: 2003-03-20 16:56:59
Message-ID: 24160.1048179419@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Fernando Papa" <fpapa(at)claxson(dot)com> writes:
> These doc say you can use array_dims to get the dimension of an array.
> But when I try to do some this
> select array_dims('{1,2,3,4,5}');
> I get this message:
> ERROR: Cannot accept a constant of type ANYARRAY

That's not an array, it's just an untyped string. This works:

regression=# select array_dims('{1,2,3,4,5}'::int[]);
array_dims
------------
[1:5]
(1 row)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reid Thompson 2003-03-20 17:03:48 Re: Handling Blobs with libpq
Previous Message Kevin 2003-03-20 16:51:51 Postgreslq Driver in Java & Windows