pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Joseph Krogh <andreak@officenet.no>
To: pgsql-jdbc@postgresql.org
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date: Tue, 08 Feb 2011 00:25:03 +0100
Message-ID: <4D507F4F.7020809@officenet.no> (raw)
In-Reply-To: <201102072238.42274.rsmogura@softperience.eu>
References: <201102070001.22259.andreak@officenet.no>
	<201102070911.20245.rsmogura@softperience.eu>
	<4D505B02.804@officenet.no>
	<201102072238.42274.rsmogura@softperience.eu>

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 <andreak@officenet.no>
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 |                                             |
------------------------+---------------------------------------------+



view thread (36+ messages)  latest in thread

Message-ID: <4D507F4F.7020809@officenet.no>
Permalink:  ../4D507F4F.7020809@officenet.no/
Also on:    postgresql.org/message-id/4D507F4F.7020809@officenet.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: andreak@officenet.no
  Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
  In-Reply-To: <4D507F4F.7020809@officenet.no>
  References: <201102070001.22259.andreak@officenet.no> <201102070911.20245.rsmogura@softperience.eu> <4D505B02.804@officenet.no> <201102072238.42274.rsmogura@softperience.eu> <4D507F4F.7020809@officenet.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox