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.