Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 50A84634299 for ; Mon, 16 Aug 2010 08:18:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 84282-06-2 for ; Mon, 16 Aug 2010 11:18:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 42DDB634286 for ; Mon, 16 Aug 2010 08:18:37 -0300 (ADT) Received: from 121-98-80-66.bitstream.orcon.net.nz ([121.98.80.66] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Okxi3-0003is-2r; Mon, 16 Aug 2010 23:18:31 +1200 Message-ID: <4C691E81.903@opencloud.com> Date: Mon, 16 Aug 2010 23:18:25 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Thomas Kellerer CC: pgsql-jdbc@postgresql.org Subject: Re: TEXT columns should indentify as java.sql.Types.CLOB References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201008/51 X-Sequence-Number: 20854 Thomas Kellerer wrote: > Toni Helenius wrote on 16.08.2010 11:01: >> 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 if I make a query to identify these fields in Java, >> the field DATA TYPE is VARCHAR and the length is 2147483647. Type >> name is correct; "TEXT". But as we need database independent code, we >> are using DATA TYPE as I presume is correct. And I think these TEXT >> fields should return java.sql.Types.CLOB as DATA TYPE instead of >> VARCHAR. > > I agree, this would make the driver more JDBC compatible and it would > behave more like other drivers. Returning Types.CLOB would imply that the preferred way to deal with those columns is via getClob() / setClob(), which surely isn't correct for TEXT columns in most cases? -O