Google Groups Home
Help | Sign in
Message from discussion ResultSetMetaData + CachedResultSet bug
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Kris Jurka  
View profile
 More options Jun 29 2006, 7:47 pm
Newsgroups: pgsql.interfaces.jdbc
From: bo...@ejurka.com (Kris Jurka)
Date: Thu, 29 Jun 2006 18:47:02 -0500 (EST)
Local: Thurs, Jun 29 2006 7:47 pm
Subject: Re: ResultSetMetaData + CachedResultSet bug

On Thu, 22 Jun 2006, Sergii Sinelnychenko wrote:
>   Today I have found a strange bug in JDBC driver (I used the last version
> avilable - 8.2dev-503). The problem is with VARCHAR fields - driver returns
> "-1" on "getPrecision()" call. But class javax.sql.rowset.RowSetMetaDataImpl
> in its "setPrecision()" method requires values of 0 and more (javadoc sais
> "precision the total number of decimal digits; must be <code>0</code> or more
> ").
> I understand that in case of VARCHAR type we cannot speak about real number
> of decimal digits - but could just driver return 0 instead of -1?

That certainly looks like a reasonable thing to do for text types.  The
one case that needs a little more thinking about is a numeric field that
has neither precision nor scale supplied.  For this we currently return -1
for both precision and scale.  The maximum precision of a numeric is 1000
digits, so we could divy it up evenly and make an unadorned numeric be
returned as numeric(1000,500), but that seems a little too much like just
making things up.  Thoughts?

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google