PostgreSQL JDBC: bytea column getMetaData().getColumns().getIn("COLUMN_SIZE") ~ 2GB - Mailing list pgsql-jdbc

From Grace Batumbya
Subject PostgreSQL JDBC: bytea column getMetaData().getColumns().getIn("COLUMN_SIZE") ~ 2GB
Date
Msg-id 4E1C7210.5040505@senecac.on.ca
Whole thread Raw
List pgsql-jdbc
Hi there,
I am using postgresql-9.0-801.jdbc3, on postgresql 9.0.4.
On a bytea column, getMetaData().getColumns().getIn("COLUMN_SIZE") returns 2147483647 yet from asking around on #postgresql on irc, the bytea has a limit just less than 1GB.

I did a bit of looking around in the jdbc driver and found this method in: org.postgresql.jdbc2.TypeInfoCache
public int getPrecision(int oid, int typmod) {
        oid = convertArrayToBaseOid(oid);
        switch (oid) {
            ...
            case Oid.TEXT:
            case Oid.BYTEA:
            default:
                return _unknownLength;
        }
    }


Why then does jdbc return 2GB instead of 1GB?

--
Grace Batumbya
Research Assistant | Seneca CDOT
Phone: 416-491-5050 x3548
cdot.senecac.on.ca

pgsql-jdbc by date:

Previous
From: Radosław Smogura
Date:
Subject: Re: Help me start postmaster on a default installation of PostgreSQL.
Next
From: Akio Iwaasa
Date:
Subject: org.postgresql.jdbc4.Jdbc4Array.free() is not yet implemented