Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 71329A97F17 for ; Mon, 26 Dec 2011 16:42:08 -0400 (AST) Received: from locatortechnologies.com ([198.64.129.55] helo=www.locatortechnologies.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RfHN1-0000SK-U7 for pgsql-jdbc@postgresql.org; Mon, 26 Dec 2011 20:42:08 +0000 Received: from [192.168.7.105] (cpe-24-24-224-57.socal.res.rr.com [24.24.224.57]) by www.locatortechnologies.com (Postfix) with ESMTP id EBE0F620008; Mon, 26 Dec 2011 15:41:52 -0500 (EST) Message-ID: <4EF8DC10.2020103@ejurka.com> Date: Mon, 26 Dec 2011 12:41:52 -0800 From: Kris Jurka User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Leandro_Guimar=E3es?= CC: pgsql-jdbc@postgresql.org Subject: Re: Bidimensional Array References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201112/82 X-Sequence-Number: 22536 On 12/26/2011 12:23 PM, Leandro Guimar=E3es 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 goo= d > approach. > > I'm using the a1.toString() method and using .split by comma to brea= k > the value and return the String[] > Your problem is that you don't really have a two dimensional array. You=20 have a one dimensional array whose contents look similar to an array,=20 but are actually just a string of text. jurka=3D# select array_ndims('{"{319.1,811.2,915.5}"}'::varchar[]); array_ndims ------------- 1 Those interior quotes are not correct. jurka=3D# select array_ndims('{{319.1,811.2,915.5}}'::varchar[]); array_ndims ------------- 2 jurka=3D# select ('{{319.1,811.2,915.5}}'::varchar[])[1][1]; varchar --------- 319.1 Kris Jurka