Re: JDBC adaptor issue - Mailing list pgsql-hackers

From Barry Lind
Subject Re: JDBC adaptor issue
Date
Msg-id 3B36D561.4090400@xythos.com
Whole thread Raw
In response to JDBC adaptor issue  (btoback@mac.com)
Responses Re: [JDBC] Re: JDBC adaptor issue  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Actually the problem is worse than I thought.  Not only do all the
get/setXXXStream methods assume the datatype is a BLOB, but also the
get/setBytes methods.  This means that it isn't possible to support
bytea as the binary datatype without also breaking some backward
compatability.

In looking at the CVS log, it appears that the stream methods were only
introduced in the 7.1 JDBC driver, since 7.1 has only been out
(production) a few months, the number of people affected will be
smaller, the setBytes() method that assumed a blob was there in 7.0, so
it is likely more people will be impacted by any change there.

thanks,
--Barry

Bruce Toback wrote:

>
> On Sunday, June 24, 2001, at 10:32 PM, Barry Lind wrote:
>
>> This is an interesting problem.  And I can't think a any easy
>> solution.  But given TOAST in 7.1 the existing implementation doesn't
>> make sense IMHO  My suggestion would be that the get/setXXXStream
>> methods work on TOASTed data types and get/setBlob be used for Blobs.
>>
>
> That would be my preference as well.
>
>> As far as your patch, I don't see that as a generic solution.  It is
>> equally likely that a Blob could contain less than 8190 characters, or
>> a varchar could contain more that 8190 characters in 7.1.
>
>
> It's certainly not a generic solution. I was looking for a solution that
> would break fewer of the applications that rely on the current
> nonstandard behavior. I'd much prefer to simply have get/set...stream
> just implement the standard behavior. But not knowing the Postgres
> developers' preferences when it comes to these questions, I chose the
> break-fewer-existing-apps approach.
>
> If the answer is that the Postgres developers are willing to tell
> current JDBC users to switch to the Blob/Clob methods when that's what
> they really mean, I'll remove the switch before submitting the patch.
>
> -- Bruce
>



pgsql-hackers by date:

Previous
From: Bruce Toback
Date:
Subject: Re: JDBC adaptor issue
Next
From: Hannu Krosing
Date:
Subject: Re: AW: Re: Re: REPLACE INTO table a la mySQL