From software@sistemat.com.ar Sat Jul 3 01:02:23 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C8B25D1B298 for ; Fri, 2 Jul 2004 22:02:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60816-01 for ; Sat, 3 Jul 2004 01:02:17 +0000 (GMT) Received: from sun2.techtelnet.net (unknown [200.69.128.98]) by svr1.postgresql.org (Postfix) with ESMTP id E5C61D1B347 for ; Fri, 2 Jul 2004 22:02:11 -0300 (ADT) Received: (qmail 27096 invoked from network); 3 Jul 2004 01:01:43 -0000 Received: from unknown (HELO sistemat.com.ar) (dfassi@sistemat.com.ar@[200.80.239.18]) (envelope-sender ) by mail (qmail-ldap-1.03) with SMTP for ; 3 Jul 2004 01:01:43 -0000 Message-ID: <40E6076C.30105@sistemat.com.ar> Date: Fri, 02 Jul 2004 22:10:04 -0300 From: "Dario V. Fassi" Organization: SISTEMATICA ingenieria de software srl User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: es, es-ar, en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Error in DatabaseMetaData TableColumn lenght.dec information Content-Type: multipart/alternative; boundary="------------050207030203070606060106" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.4 tagged_above=0.0 required=5.0 tests=HTML_30_40, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: * X-Archive-Number: 200407/23 X-Sequence-Number: 10407 This is a multi-part message in MIME format. --------------050207030203070606060106 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, I whish to report a erroneous information returned by DatabaseMetaData.getColumns() method. This happens with ResultSet's column (7) COLUMN_SIZE and (9) DECIMAL_DIGITS , when DatabaseMetaData.getColumns() inform about a VIEW with columns formed with : coalesce , case or numeric operations over DECIMAL fields. Suppose CREATE TABLE A ( f1 DEC(6,3), f2 dec(6,3) ); CREATE VIEW B as ( select ( f1 + f2 ) as f from a; Then DatabaseMetaData.getColumns() returns: VIEW B F NUMERIC( 65535 , -65531 ) This error its very molest because if you are trying to do CodeGeneration tools from DatabaseMetaData , you get lost. Any suggestion will be appreciated. Best regards, Dario V. Fassi SISTEMATICA ingenieria de software srl Ituzaingo 1628 (2000) Rosario, Santa Fe, Argentina. Tel / Fax: +54 (341) 485.1432 / 485.1353 --------------050207030203070606060106 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I whish to report a erroneous information returned by   DatabaseMetaData.getColumns()  method.

This happens with ResultSet's column (7) COLUMN_SIZE  and  (9) DECIMAL_DIGITS ,
when DatabaseMetaData.getColumns() inform about a VIEW with columns formed with :
coalesce , case or numeric operations over DECIMAL fields.

Suppose

CREATE TABLE A (  f1 DEC(6,3), f2 dec(6,3) );
CREATE VIEW B as ( select ( f1 + f2 ) as f from a;

Then DatabaseMetaData.getColumns() returns:

VIEW B
    F   NUMERIC(  65535 ,  -65531 )

This error its very molest because if you are trying to do CodeGeneration tools from DatabaseMetaData , you get lost.

Any suggestion will be appreciated.
Best regards,

    Dario V. Fassi


SISTEMATICA ingenieria de software  srl
Ituzaingo 1628  (2000)  Rosario, Santa Fe, Argentina.
Tel / Fax:  +54 (341) 485.1432 / 485.1353



--------------050207030203070606060106-- From books@ejurka.com Fri Jul 9 23:53:27 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D063AD1B1A0 for ; Fri, 9 Jul 2004 20:53:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64488-06 for ; Fri, 9 Jul 2004 23:53:22 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id D83C4D1B266 for ; Fri, 9 Jul 2004 20:53:13 -0300 (ADT) Received: (qmail 19386 invoked by uid 1112); 9 Jul 2004 23:53:11 -0000 Date: Fri, 9 Jul 2004 18:53:11 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: "Dario V. Fassi" Cc: pgsql-jdbc@postgresql.org Subject: Re: Error in DatabaseMetaData TableColumn lenght.dec In-Reply-To: <40E6076C.30105@sistemat.com.ar> Message-ID: References: <40E6076C.30105@sistemat.com.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/79 X-Sequence-Number: 10463 On Fri, 2 Jul 2004, Dario V. Fassi wrote: > Hi, I whish to report a erroneous information returned by > DatabaseMetaData.getColumns() method. > > Suppose > > CREATE TABLE A ( f1 DEC(6,3), f2 dec(6,3) ); > CREATE VIEW B as ( select ( f1 + f2 ) as f from a; > > Then DatabaseMetaData.getColumns() returns: > > VIEW B > F NUMERIC( 65535 , -65531 ) > I've modified the cvs version of the driver to return numeric(1000,1000) which is the maximum precision and scale you are allowed to define. A more complete solution is outside the realm of the JDBC driver. Kris Jurka From tgl@sss.pgh.pa.us Sat Jul 10 17:07:17 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 39C2FD1B184 for ; Sat, 10 Jul 2004 14:07:17 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 75360-07 for ; Sat, 10 Jul 2004 17:07:09 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id F012CD1B181 for ; Sat, 10 Jul 2004 14:07:07 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6AH761S013577; Sat, 10 Jul 2004 13:07:06 -0400 (EDT) To: Kris Jurka Cc: "Dario V. Fassi" , pgsql-jdbc@postgresql.org Subject: Re: Error in DatabaseMetaData TableColumn lenght.dec In-reply-to: References: <40E6076C.30105@sistemat.com.ar> Comments: In-reply-to Kris Jurka message dated "Fri, 09 Jul 2004 18:53:11 -0500" Date: Sat, 10 Jul 2004 13:07:06 -0400 Message-ID: <13576.1089479226@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/85 X-Sequence-Number: 10469 Kris Jurka writes: > I've modified the cvs version of the driver to return numeric(1000,1000) > which is the maximum precision and scale you are allowed to define. A > more complete solution is outside the realm of the JDBC driver. That doesn't sound like a usable answer at all. A client that believes this result will think that the value cannot contain any digits to the left of the decimal point --- which is certainly not so. Does the JDBC spec allow you to return NULL for these entries? That's what we recently fixed the information_schema views to do for unconstrained numeric columns. regards, tom lane From software@sistemat.com.ar Sat Jul 10 17:16:29 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E21E8D1B181 for ; Sat, 10 Jul 2004 14:16:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78715-06 for ; Sat, 10 Jul 2004 17:16:22 +0000 (GMT) Received: from mail.svhost.com.ar (mail.svhost.com.ar [200.80.239.22]) by svr1.postgresql.org (Postfix) with ESMTP id 9B7A4D1B18F for ; Sat, 10 Jul 2004 14:16:20 -0300 (ADT) Received: from sistemat.com.ar (devel.sistemat.com.ar [192.168.1.40]) by mail.svhost.com.ar (Postfix) with ESMTP id 0E3A5239EE; Sat, 10 Jul 2004 14:14:57 -0300 (ART) Message-ID: <40F02681.2010209@sistemat.com.ar> Date: Sat, 10 Jul 2004 14:25:21 -0300 From: "Dario V. Fassi" Organization: SISTEMATICA ingenieria de software srl User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: es, es-ar, en-us, en MIME-Version: 1.0 To: Kris Jurka , pgsql-jdbc@postgresql.org Subject: Re: Error in DatabaseMetaData TableColumn lenght.dec information References: <40E6076C.30105@sistemat.com.ar> In-Reply-To: Content-Type: multipart/alternative; boundary="------------060605030305010305080804" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.0 tagged_above=0.0 required=5.0 tests=HTML_20_30, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: * X-Archive-Number: 200407/87 X-Sequence-Number: 10471 This is a multi-part message in MIME format. --------------060605030305010305080804 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Kris Jurka wrote: >On Fri, 2 Jul 2004, Dario V. Fassi wrote: > > > >>Hi, I whish to report a erroneous information returned by >>DatabaseMetaData.getColumns() method. >> >>Suppose >> >>CREATE TABLE A ( f1 DEC(6,3), f2 dec(6,3) ); >>CREATE VIEW B as ( select ( f1 + f2 ) as f from a; >> >>Then DatabaseMetaData.getColumns() returns: >> >>VIEW B >> F NUMERIC( 65535 , -65531 ) >> >> >> > >I've modified the cvs version of the driver to return numeric(1000,1000) >which is the maximum precision and scale you are allowed to define. A >more complete solution is outside the realm of the JDBC driver. > >Kris Jurka > > Kris, A return value of numeric(1000,1000) , is far better than numeric(65535,-65531) , but this mean a number with all the presicion in the fractional part and is not very usefull. Why not a more login value like "Numeric(100,50)" , yet oversized but more appropiate. Can you imagine a number with 1000 digit's presicion, it's impractical and undisplayable. Dario Fassi. --------------060605030305010305080804 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

Kris Jurka wrote:
On Fri, 2 Jul 2004, Dario V. Fassi wrote:

  
Hi, I whish to report a erroneous information returned by   
DatabaseMetaData.getColumns()  method.

Suppose

CREATE TABLE A (  f1 DEC(6,3), f2 dec(6,3) );
CREATE VIEW B as ( select ( f1 + f2 ) as f from a;

Then DatabaseMetaData.getColumns() returns:

VIEW B
    F   NUMERIC(  65535 ,  -65531 )

    

I've modified the cvs version of the driver to return numeric(1000,1000) 
which is the maximum precision and scale you are allowed to define.  A 
more complete solution is outside the realm of the JDBC driver.

Kris Jurka
  
Kris,

A return value of numeric(1000,1000) , is far better than  numeric(65535,-65531) , but this mean a number with all the presicion in the fractional part and is not very usefull.

Why not a more login value like    "Numeric(100,50)"  , yet oversized but more appropiate.
Can you imagine a number with 1000 digit's presicion, it's impractical and undisplayable.

Dario Fassi.

--------------060605030305010305080804-- From books@ejurka.com Sun Jul 11 05:13:13 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ADA5DD1B266 for ; Sun, 11 Jul 2004 02:13:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90394-08 for ; Sun, 11 Jul 2004 05:13:15 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 80568D1B20E for ; Sun, 11 Jul 2004 02:13:09 -0300 (ADT) Received: (qmail 24740 invoked by uid 1112); 11 Jul 2004 05:13:14 -0000 Date: Sun, 11 Jul 2004 00:13:14 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Tom Lane Cc: "Dario V. Fassi" , pgsql-jdbc@postgresql.org Subject: Re: Error in DatabaseMetaData TableColumn lenght.dec In-Reply-To: <13576.1089479226@sss.pgh.pa.us> Message-ID: References: <40E6076C.30105@sistemat.com.ar> <13576.1089479226@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/88 X-Sequence-Number: 10472 On Sat, 10 Jul 2004, Tom Lane wrote: > Kris Jurka writes: > > I've modified the cvs version of the driver to return numeric(1000,1000) > > which is the maximum precision and scale you are allowed to define. A > > more complete solution is outside the realm of the JDBC driver. > > That doesn't sound like a usable answer at all. A client that believes > this result will think that the value cannot contain any digits to the > left of the decimal point --- which is certainly not so. I blew this one. For some reason I was thinking 1000, 1000 was 1000 to the left and right of the decimal. > Does the JDBC spec allow you to return NULL for these entries? That's > what we recently fixed the information_schema views to do for > unconstrained numeric columns. No, the method returns "int" which is a primitive type and therefore can't be null. Maybe -1? I'm not sure what the best answer is. Kris Jurka