X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 792663A4D6F for ; Fri, 7 Jan 2005 03:46:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45373-01 for ; Fri, 7 Jan 2005 03:46:21 +0000 (GMT) Received: from mailgate.uni-paderborn.de (mailgate.uni-paderborn.de [131.234.22.32]) by svr1.postgresql.org (Postfix) with ESMTP id 979C63A4D5F for ; Fri, 7 Jan 2005 03:46:24 +0000 (GMT) Received: from p5484bde7.dip.t-dialin.net ([84.132.189.231] helo=gwinet.sven.home-net) by mailgate.uni-paderborn.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.43) id 1Cml4T-0003mu-UI; Fri, 07 Jan 2005 04:45:54 +0100 Received: from [10.1.1.20] (unknown [10.1.1.20]) by gwinet.sven.home-net (Postfix) with ESMTP id 7754269F673; Fri, 7 Jan 2005 04:46:17 +0100 (CET) Message-ID: <41DE0680.4030103@upb.de> Date: Fri, 07 Jan 2005 04:48:16 +0100 From: =?ISO-8859-15?Q?Sven_K=F6hler?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a4) Gecko/20040927 X-Accept-Language: de, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: BLOBs etc References: <41DDFC46.1080807@upb.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-UNI-PB_FAK-EIM-MailScanner-Information: Please see http://imap.uni-paderborn.de for details X-UNI-PB_FAK-EIM-MailScanner: Found to be clean X-UNI-PB_FAK-EIM-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.208, required 4, AUTH_EIM_USER -5.00, RCVD_IN_NJABL_DUL 1.66, RCVD_IN_SORBS_DUL 0.14) X-MailScanner-From: skoehler@upb.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/35 X-Sequence-Number: 11915 >>BTW: why don't getInputStream/getBLOB/... work for _both_, bytea and >>oid? Shouldn't the JDBC driver be abled to determine the used datatype >>and act accordingly? I'm sure you had you reasons. I'd just like to know >>them. > > It certainly could do that. I'm guessing that it wasn't done to > maintain symmetry with the set methods, knowing that only one can > work. Making getInputStream work on oid would be easy, but making > getBlob work on bytea would be more work to write a wrapper. There is > also no real reason to use getBlob on bytea because no streaming is > supported. > > Do you think the increased flexiblity is worth the potential for > confusion when the corresponding set method doesn't work? Ohh, well. The "getInputStream/getBLOB/..." above was ment to include the set-Methods. After all you said, it seems reasonable not to impelement set/getBlob() for bytea. On the other hand, it may lower compatibility of the JDBC driver to generic applications, if there is a datatype that either set/getBlob() or set/getBinaryStream() doesn't work for. So one should avoid using bytea. But am i right that set/getBinaryStream won't work for oid columns? I think delegating set/getBinaryStream() to set/getBlob() is easy if the JDBC driver would know when to do it. Would that be possible? That would make oid columns the most compatible as thay would allow to use both: the binarystream methods and the blob methods. The compatibility of the JDBC could be improved by that.