Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 11FC59FB2F6 for ; Fri, 3 Nov 2006 03:22:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 23008-02 for ; Fri, 3 Nov 2006 03:22:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id C34CC9FB2AF for ; Fri, 3 Nov 2006 03:22:45 -0400 (AST) Received: (qmail 14983 invoked by uid 1112); 3 Nov 2006 07:22:44 -0000 Date: Fri, 3 Nov 2006 02:22:44 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: Thomas Hallgren cc: Postgres-JDBC Subject: Re: ResultSetMetaData + CachedResultSet bug In-Reply-To: <44A4DC58.8030200@tada.se> Message-ID: References: <032401c6960c$66ad1170$3a14a8c0@bossdev.com.ua> <44A4DC58.8030200@tada.se> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/19 X-Sequence-Number: 16061 On Fri, 30 Jun 2006, Thomas Hallgren wrote: > Kris Jurka wrote: >> >> [what to do about precision for non-numeric types] >> > I think the current -1 is reasonable for non numeric types. For the numeric > types however, the interpretation should be that 0 is unlimited. A numeric > should never return -1 and should accept setPrecision(colidx, 0) as 'no > limit', i.e. > > 0 = unlimited > -1 = not applicable > > The rationale is that a) stating that a varchar has zero decimal digits is > wrong since it doesn't have any notion of decimal digits, and b) a precision > of zero for a numeric doesn't make sense when interpreted verbatim. > The latest javadocs have clarified what they expect precision to mean for non-numeric datatypes. http://download.java.net/jdk6/docs/api/java/sql/ResultSetMetaData.html#getPrecision(int) I've adjusted the driver to follow the new rules and not return -1 anymore. Kris Jurka