pgsql jdbc driver seems flawed, it loads all the data in memory when reading bytea data columns
this is the driver method... PgResultSet class
@Pure
public @Nullable InputStream getBinaryStream(@Positive int columnIndex) throws SQLException {
this.connection.getLogger().log(Level.FINEST, " getBinaryStream columnIndex: {0}", columnIndex);
byte[] value = this.getRawValue(columnIndex);
if (value == null) {
return null;
} else {
byte[] b = this.getBytes(columnIndex);
return b != null ? new ByteArrayInputStream(b) : null;
}
}
this will load all in memory and if the data is big the app will go on OOM. can some body confirm i got this problem, how to read big byteea columns ?