pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: DGPickett <DGPickett@aol.com>
Cc: pgsql-jdbc@postgresql.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> (raw)
In-Reply-To: <be6ffbdc-6190-4f2b-8e2e-b45fa9e5a596@r27g2000vbp.googlegroups.com>
References: <095cddc9-bca7-41a5-84a8-0faca7adadc2@f11g2000vbf.googlegroups.com>
	<Pine.BSO.4.64.0902251858180.2899@leary.csoft.net>
	<be6ffbdc-6190-4f2b-8e2e-b45fa9e5a596@r27g2000vbp.googlegroups.com>



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



view thread (13+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0902261310090.24291@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0902261310090.24291@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0902261310090.24291@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, DGPickett@aol.com
  Subject: Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?
  In-Reply-To: <Pine.BSO.4.64.0902261310090.24291@leary.csoft.net>
  References: <095cddc9-bca7-41a5-84a8-0faca7adadc2@f11g2000vbf.googlegroups.com> <Pine.BSO.4.64.0902251858180.2899@leary.csoft.net> <be6ffbdc-6190-4f2b-8e2e-b45fa9e5a596@r27g2000vbp.googlegroups.com> <Pine.BSO.4.64.0902261310090.24291@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox