how to make PostgreSQL JDBC driver transfer data as binary ratherthan as a string - Mailing list pgsql-jdbc

From Leonid Mikhailov
Subject how to make PostgreSQL JDBC driver transfer data as binary ratherthan as a string
Date
Msg-id 932AB9BB-E80B-41BF-A3F3-EDD4B48D487F@esri.com
Whole thread Raw
Responses Re: how to make PostgreSQL JDBC driver transfer data as binary ratherthan as a string  (Jorge Solórzano <jorsol@gmail.com>)
List pgsql-jdbc

Hello,

 

During performance testing of our application we have noticed that the amount of data being transferred from PostgreSQL database to the application when fetching content of a BYTEA field is twice the size of the data stored in this field. Once received the volume of the data is exactly the same as stored. It seems that it happens because the data is transferred as a string rather than as a binary. According to the doc (https://jdbc.postgresql.org/documentation/head/connect.html) it should be possible to tell JDBC driver to use binary protocol by appending binaryTransferEnable = BYTEA to the end of the JDBC connection URL, like this:

jdbc:postgresql://<servername>:7654/<databaseName>?binaryTransferEnable=BYTEA

Unfortunately it doesn’t seem to make any difference. Are we doing something incorrectly?

 

Thanks,

Leonid

 

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: [pgjdbc/pgjdbc] ed5f75: Update checkstyle to 8.18 (#1447)
Next
From: Jorge Solórzano
Date:
Subject: Re: how to make PostgreSQL JDBC driver transfer data as binary ratherthan as a string