Re: [HACKERS] JDBC adaptor issue

From: Barry Lind <barry(at)xythos(dot)com>
To: Bruce Toback <btoback(at)mac(dot)com>
Cc: Barry Lind <blind(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [HACKERS] JDBC adaptor issue
Date: 2001-06-25 06:08:33
Message-ID: 3B36D561.4090400@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

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
>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lincoln Yeoh 2001-06-25 06:34:51 Re: Encrypting pg_shadow passwords
Previous Message Lincoln Yeoh 2001-06-25 06:07:53 Re: Encrypting pg_shadow passwords

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2001-06-25 12:11:10 RE: [ADMIN] High memory usage [PATCH]
Previous Message Barry Lind 2001-06-25 05:40:42 Re: Instrumenting and Logging in JDBC