Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4E0F21337B8A for ; Mon, 7 Feb 2011 19:25:15 -0400 (AST) 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 97703-02 for ; Mon, 7 Feb 2011 23:25:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ns1.officenet.no (unknown [195.159.87.244]) by mail.postgresql.org (Postfix) with ESMTP id 601F71337B8D for ; Mon, 7 Feb 2011 19:25:07 -0400 (AST) Received: from [79.161.204.50] (helo=[192.168.0.172]) by ns1.officenet.no with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PmaS8-0006jW-4l for pgsql-jdbc@postgresql.org; Tue, 08 Feb 2011 00:25:06 +0100 Message-ID: <4D507F4F.7020809@officenet.no> Date: Tue, 08 Feb 2011 00:25:03 +0100 From: Andreas Joseph Krogh Organization: OfficeNet AS User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob References: <201102070001.22259.andreak@officenet.no> <201102070911.20245.rsmogura@softperience.eu> <4D505B02.804@officenet.no> <201102072238.42274.rsmogura@softperience.eu> In-Reply-To: <201102072238.42274.rsmogura@softperience.eu> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201102/37 X-Sequence-Number: 21435 On 02/07/2011 10:38 PM, Radosław Smogura wrote: > PostgreSQL doesn't have field type CLOB, nor BLOB. I know that. > If eveny it would be possible for driver to read CLOB from varchar, driver > will be unable to set proper value when calling UPDATE or INSTERT. It is due > to internal way how PSQL deals with those values. Isn't the whole concept of CLOB just a bi-product of old proprietary database-design where some RDBMS'es are unable to store arbitrary long varchars? What properties do CLOBs have that varchars don't, except being large? I don't understand why CLOBs can't be treated like text in the PG-driver as PG handles large Strings just fine in varchar/text-columns. If a DBA has for some reason defined a scale, say VARCHAR(10), on a column and tries to store a CLOB in it, well - his problem; He should get an Exception from PG. > I know drivers supports custom casting, but casting from varchar to clob is > implicite prohibted in JDBC. If you look at B-6 table x indicates possible > casting. There is no x, nor X on varchar cross clob Does it not make sense to you to be able to cast a *character large object* to a *variable length character*-type and visa versa? If the only argument is spec-complience I'm not getting it... -- Andreas Joseph Krogh Senior Software Developer / CTO Public key: http://home.officenet.no/~andreak/public_key.asc ------------------------+---------------------------------------------+ OfficeNet AS | The most difficult thing in the world is to | Rosenholmveien 25 | know how to do a thing and to watch | 1414 Trollåsen | somebody else doing it wrong, without | NORWAY | comment. | Org.nr: NO 981 479 076 | | | | Tlf: +47 24 15 38 90 | | Fax: +47 24 15 38 91 | | Mobile: +47 909 56 963 | | ------------------------+---------------------------------------------+