PostgreSQL JDBC FLOAT8 passed as string

While profiling loading a large dataset from Postgres 9.3.5 with the latest JDBC drivers (9.4-1201-jdbc41) I noticed a lot of time wasted on the AbstractJdbc2ResultSet.getDouble () method where the driver converts the String value to double using Double.toDouble () ...

Looking at the source code, it seems like there is a way to pass double values โ€‹โ€‹in binary, but I couldn't find a way to get the server to send back binary encoded double values โ€‹โ€‹(tried setting binaryTransfer to true in the connection string as suggested at https: //wiki.postgresql .org / wiki / JDBC-BinaryTransfer , nothing has changed).

Has anyone encountered similar behavior when loading data from Postgres, or have any idea why it is implemented this way? I found a recent discussion of a similar question here http://www.postgresql.org/message-id/flat/ 36333.1430411802@sss.pgh.pa.us # 36333.1430411802@sss.pgh.pa.us ) but there weren't any convincing answers.

+3


source to share


1 answer


You need to follow the instruction at least 5-6 (or possibly more) to get the binary translation mode. More details: https://github.com/pgjdbc/pgjdbc/issues/642



0


source







All Articles