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
> 



Sun, 24 Jun 2001 23:08:33 -0700
Barry Lind <barry@xythos.com>
Re: [HACKERS] JDBC adaptor issue
> 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.

If you are looking for votes, you can break backward compatibility here.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Wed, 11 Jul 2001 13:43:54 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Re: [HACKERS] JDBC adaptor issue