Re: [QUESTION] How to retrieve type info for ROW

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: Sergey Nuyanzin <snuyanzin(at)gmail(dot)com>
Cc: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: [QUESTION] How to retrieve type info for ROW
Date: 2021-12-07 13:15:42
Message-ID: CADK3HHJwqVPHW=HvaFEoS5PUprtcEb6KHBqkOa=sCWPnDyc=vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Sergey,

What I suspected it would return. The problem is the backend does not
provide us with anything better than unknown OID

Dave Cramer
www.postgres.rocks

On Tue, 7 Dec 2021 at 03:54, Sergey Nuyanzin <snuyanzin(at)gmail(dot)com> wrote:

> Hi Dave
>
> it returns object with field referencing to some unknown oid (screen
> attached)
>
> [image: image.png]
>
>
> On Mon, Dec 6, 2021 at 1:47 PM Dave Cramer <davecramer(at)postgres(dot)rocks>
> wrote:
>
>> Hi Sergey,
>>
>> What does getResultSetMetadata return?
>>
>>
>> Dave Cramer
>> www.postgres.rocks
>>
>>
>> On Mon, 29 Nov 2021 at 07:19, Sergey Nuyanzin <snuyanzin(at)gmail(dot)com>
>> wrote:
>>
>>> Hi everyone
>>>
>>> I'm trying to read data from Postgres with pgjdbc.
>>> The current question is: how can I retrieve data about nested row types?
>>> I tried to find an answer via docs but failed
>>>
>>> E.g. there is a query
>>> SELECT ROW(1, 'one', ROW(1, 'one', null, ROW(1)));
>>>
>>> I noticed some projects where people take its string representation like
>>> java.sql.ResultSet#getString(int)
>>> parse it and reconstruct the object...
>>> however this way probably could lead to type info losing
>>>
>>> I wonder if there is a more subtle way here?
>>>
>>> --
>>> Best regards,
>>> Sergey
>>>
>>
>
> --
> Best regards,
> Sergey
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message JDBC Project via PostgreSQL Announce 2021-12-13 15:46:38 PostgreSQL JDBC and the log4j CVE
Previous Message Sergey Nuyanzin 2021-11-29 11:01:21 [QUESTION] How to retrieve type info for ROW