Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1448F632629 for ; Mon, 16 Aug 2010 06:11:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 44826-03 for ; Mon, 16 Aug 2010 09:11:38 +0000 (UTC) X-Greylist: delayed 00:09:29.039463 by SQLgrey-1.7.6 Received: from espresso1.syncrontech.com (espresso1.syncrontech.com [213.28.98.34]) by mail.postgresql.org (Postfix) with ESMTP id C49B563258C for ; Mon, 16 Aug 2010 06:11:38 -0300 (ADT) Received: from ink.sad.syncrontech.com (ink.syncrontech.com [192.168.2.107]) by espresso1.syncrontech.com (8.14.4/8.14.4) with ESMTP id o7G9266o030037 for ; Mon, 16 Aug 2010 12:02:06 +0300 (EEST) (envelope-from Toni.Helenius@syncrontech.com) Received: from ink.sad.syncrontech.com ([192.168.2.107]) by ink.sad.syncrontech.com ([192.168.2.107]) with mapi; Mon, 16 Aug 2010 12:02:01 +0300 From: Toni Helenius To: "pgsql-jdbc@postgresql.org" Date: Mon, 16 Aug 2010 12:01:56 +0300 Subject: TEXT columns should indentify as java.sql.Types.CLOB Thread-Topic: TEXT columns should indentify as java.sql.Types.CLOB Thread-Index: Acs9Ia1tv4cuOgZ8RWS9Bn+kC7DG9A== Message-ID: Accept-Language: en-US, fi-FI Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, fi-FI Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/49 X-Sequence-Number: 20852 Hello, I'm using Postgres 8.3.11 database and the latest JDBC driver 8.4 Build 701= (JDBC 4) + Java 6. In our databases there are TEXT type columns. However i= f I make a query to identify these fields in Java, the field DATA TYPE is V= ARCHAR and the length is 2147483647. Type name is correct; "TEXT". But as w= e need database independent code, we are using DATA TYPE as I presume is co= rrect. And I think these TEXT fields should return java.sql.Types.CLOB as D= ATA TYPE instead of VARCHAR. Here is some code: Connection fromConn; DatabaseMetaData metaFrom; String userFrom; fromConn =3D from.getConnection(); metaFrom =3D fromConn.getMetaData(); userFrom =3D ((PooledConnection)from).getTableOwner(); ResultSet cols =3D metaFrom.getColumns(null, userFrom, code, null); while (cols.next()) { cols.getShort("DATA_TYPE"); cols.getString("TYPE_NAME"); } -- Toni Helenius / Syncron Tech Oy Lappeenranta, Finland