X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 316979FA319 for ; Fri, 30 Jun 2006 13:23:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 75869-08 for ; Fri, 30 Jun 2006 13:23:17 -0300 (ADT) 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 1BE0C9FA192 for ; Fri, 30 Jun 2006 13:23:13 -0300 (ADT) Received: (qmail 6983 invoked by uid 1112); 30 Jun 2006 16:23:10 -0000 Date: Fri, 30 Jun 2006 11:23:10 -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: 200606/142 X-Sequence-Number: 15422 On Fri, 30 Jun 2006, Thomas Hallgren wrote: > 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 > > A setPrecision call on types where precision has no meaning should IMO yield > an exception. > > 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. I'm not sure what the harm in using zero for text types' precision is. Yes, I agree it'd be best if all applications were smart enough to use the type information correctly, but they're not. Especially when it's something in the standard JDK that everyone uses I think we should try to work around it if we can. What about scale for an unspecified numeric? zero is a legitimate scale so that can't be used for unlimited, but RowSetMetaDataImpl doesn't like anything < 0. Kris Jurka