On 12/26/2011 12:23 PM, Leandro Guimarães wrote:
> Hello Kris,
> thanks for your answer. The dataType is varchar.
>
> I did a workaround to solve the problem, but i'm sure it's not a good
> approach.
>
> I'm using the a1.toString() method and using .split by comma to break
> the value and return the String[]
>
Your problem is that you don't really have a two dimensional array. You
have a one dimensional array whose contents look similar to an array,
but are actually just a string of text.
jurka=# select array_ndims('{"{319.1,811.2,915.5}"}'::varchar[]);
array_ndims
-------------
1
Those interior quotes are not correct.
jurka=# select array_ndims('{{319.1,811.2,915.5}}'::varchar[]);
array_ndims
-------------
2
jurka=# select ('{{319.1,811.2,915.5}}'::varchar[])[1][1];
varchar
---------
319.1
Kris Jurka