Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?


  • From: Kris Jurka <books(at)ejurka(dot)com>
  • To: DGPickett <DGPickett(at)aol(dot)com>
  • Cc: pgsql-jdbc(at)postgresql(dot)org
  • Subject: Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?
  • Date: Thu, 26 Feb 2009 13:18:55 -0500 (EST)
  • Message-id: <Pine.BSO.4.64.0902261310090.24291@leary.csoft.net> <text/plain>



On Thu, 26 Feb 2009, DGPickett wrote:

I feel it runs contrary to the purpose of JDBC to make clients have
postgres-specific code for this response.  The common JDBC
speccification does not support returning int max (or anything else)
for "I don't know."

Exactly. Since the spec doesn't say what to do, what do you want the JDBC driver to do? Throw an exception? That's not helpful at all. The JDBC team has come up with a solution that works for most clients. If you have a concrete suggestion as to how this case should be handled that will work for everyone, then we'd be glad to hear it. Just wishing this case didn't exist isn't helpful.

It seems unreasonable that this implementation cannot deal with these
trivial cases.  I am not sure whether the fault lies with the JDBC
implementation or the underlying RDBMS server, that we cannot
determine that "X" is 1 byte wide...

The server is responsible for determining the type and length of data, not the JDBC driver. The server tells the JDBC driver that it is unknown and the driver has to do something with it. You are still ignoring the fact that there must be cases where the server cannot possibly know the length of a piece of data even if it was capable of of handling the simpler cases.

Kris Jurka



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group