79746603

Date: 2025-08-26 08:55:49
Score: 2
Natty:
Report link

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 ?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Aris