pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lukas Eder <lukas.eder@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: UDT arrays
Date: Wed, 23 Feb 2011 13:45:28 -0800 (PST)
Message-ID: <3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com> (raw)
References: <68ad45f0-460b-4483-a4df-13b69777707f@s18g2000vbe.googlegroups.com>

On Feb 8, 12:26 am, Lukas Eder <lukas.e...@gmail.com> wrote:
> I was wondering, is JDBC driver support for the combination of UDT's
> and arrays planned for the near future? I couldn't find any
> documentation on the JDBC drivers website.

After the rather confusing input about a third-party JDBC driver, I
can confirm that access to UDT arrays is possible via the standard
JDBC driver, if done like this:

    // This returns a serialised array. Not very convenient
    ResultSet rs =...
    String serialised = rs.getObject(index);

Or like this

    // This allows for iterating over array elements
    // and assembling it manually. I'll use this method
    // in jOOQ
    ResultSet rs =...
    ResultSet iterator = rs.getArray(index).getResultSet();

But not like this

    // This would be most convenient
    ResultSet rs =...
    Object[] array = rs.getArray(index).getArray();

> Is there any specific reason (apart from the fact that UDT's and/or
> ARRAYs are not used often) for this lack of implementation? Clearly,
> the database itself supports this combination. I can easily insert and
> select data from a table holding UDT arrays

The question was answered in another thread. I can live with the above
workaround...



view thread (10+ messages)

Message-ID: <3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com>
Permalink:  ../3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com/
Also on:    postgresql.org/message-id/3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: lukas.eder@gmail.com
  Subject: Re: UDT arrays
  In-Reply-To: <3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com>
  References: <68ad45f0-460b-4483-a4df-13b69777707f@s18g2000vbe.googlegroups.com> <3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox