Re: Retrieving multidimentional array-column using JDBC - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Retrieving multidimentional array-column using JDBC
Date
Msg-id alpine.BSO.2.00.1003101306580.29315@leary.csoft.net
Whole thread Raw
In response to Retrieving multidimentional array-column using JDBC  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: Retrieving multidimentional array-column using JDBC  (Andreas Joseph Krogh <andreak@officenet.no>)
List pgsql-jdbc

On Wed, 10 Mar 2010, Andreas Joseph Krogh wrote:

> I have a query which returns a multidimentional array (2D) of varchar
> and I'm having problems retrieving the results using JDBC.
>
> First, since PG doesn't support arrays of arrays, I've created a custom
> type:

PG does support multidimensional arrays:

kjurka=# select array[array['a','b'],array['c','d']];
      array
---------------
  {{a,b},{c,d}}
(1 row)

You can then unnest these arrays according to the
testMultiDimensionalArray or testRecursiveResultSets examples here:


http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/jdbc/pgjdbc/org/postgresql/test/jdbc2/ArrayTest.java?rev=1.19&content-type=text/x-cvsweb-markup

Kris Jurka

pgsql-jdbc by date:

Previous
From: dmp
Date:
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: Retrieving multidimentional array-column using JDBC