Обсуждение: PostgreSQL JDBC: bytea column getMetaData().getColumns().getIn("COLUMN_SIZE") ~ 2GB
PostgreSQL JDBC: bytea column getMetaData().getColumns().getIn("COLUMN_SIZE") ~ 2GB
От
Grace Batumbya
Дата:
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.
Why then does jdbc return 2GB instead of 1GB?
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.
Why then does jdbc return 2GB instead of 1GB?
--
Re: PostgreSQL JDBC: bytea column getMetaData().getColumns().getIn("COLUMN_SIZE") ~ 2GB
От
Grace Batumbya
Дата:
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;
}
}
where _unknownLength is 2147483647
On 7/12/2011 9:03 AM, Grace Simon Batumbya wrote:
public int getPrecision(int oid, int typmod) {
oid = convertArrayToBaseOid(oid);
switch (oid) {
...
case Oid.TEXT:
case Oid.BYTEA:
default:
return _unknownLength;
}
}
where _unknownLength is 2147483647
On 7/12/2011 9:03 AM, Grace Simon Batumbya wrote:
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.
Why then does jdbc return 2GB instead of 1GB?--