Re: [JDBC] getTypeInfo - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: [JDBC] getTypeInfo
Date
Msg-id CADK3HHKxtTCKttEDmUZME+pR+XDcnqhDT2ieJHsuti=3dUj-DA@mail.gmail.com
Whole thread Raw
In response to [JDBC] getTypeInfo  (Jan Motl <yzan@volny.cz>)
List pgsql-jdbc

On 14 December 2016 at 14:04, Jan Motl <yzan@volny.cz> wrote:
Hi Dave,

> Curious: Why do you care about the order ?
The driver can return quite many data types because, beside other, it returns 2 tuples per relation in the database:
        https://www.postgresql.org/message-id/CADK3HHLK6V4JSfiGHLst2yQKO8rnKqObZefUaF0rDCqRASZpfw%40mail.gmail.com
So I thought I could read rows from the resultSet while DATA_TYPES =< 93 and ignore the rest (currently thousands of rows on my instance of PostgreSQL but in theory billions of rows are possible), since I am interested only in processing of DATA_TYPES =< 93. But if the order of the rows in the resultSet is not in ascending order of DATA_TYPE, I have to read all rows from the resultSet.

I do not have a current need for correct ordering beyond DATA_TYPE resolution. But I can imagine that the correct ordering could be helpful if I wanted to write Java data types into a database the agnostic way (e.g. if I wanted to write down BIGINT, it could be helpful if the driver proposed to use int8 instead of oid and I did not have to hardcode the mapping for each database vendor (or use a library that would do that)).

Beside of that, all official drivers for other databases that I tested (MySQL, Oracle, SAS) return the data types in the correct order.

Fair enough

I've create an issue here: https://github.com/pgjdbc/pgjdbc/issues/716


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: [JDBC] getTypeInfo
Next
From: Jeremy Whiting
Date:
Subject: Re: Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)