Re: UDT arrays

Поиск
Список
Период
Сортировка
От Lukas Eder
Тема Re: UDT arrays
Дата
Msg-id 3a2e9872-dfd2-48ea-94d8-6cc72b3d5a28@x13g2000vbe.googlegroups.com
обсуждение исходный текст
Ответ на UDT arrays  (Lukas Eder <lukas.eder@gmail.com>)
Список pgsql-jdbc
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...

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Mike Fowler
Дата:
Сообщение: Re: Failing test in org.postgresql.test.jdbc2.DateTest
Следующее
От: Clemens Eisserer
Дата:
Сообщение: Slow query execution over WAN network