Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 604D21337B77 for ; Fri, 26 Nov 2010 11:25:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 51554-04 for ; Fri, 26 Nov 2010 15:25:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id D22361337B43 for ; Fri, 26 Nov 2010 11:25:03 -0400 (AST) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 1F94228469; Fri, 26 Nov 2010 10:25:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=hSAiju9K+3hV8yzsdVq2AlzsBDM=; b=uFVvdm pwsrhT5KB3aoEJih7LWJOfr/GejTdRRiVmdcrrAnq/sxnMpj7fUxXqBcTeORRTt4 aYngSvLexv7RMwmmlHm0mIo0zYtC4rTDGBvIissXVbBXDJtuilhStnGE5x5gWk+U h0ilVKAgyJKEcaEErX2ZAxaNhNa5PFQHPyV2w= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id EF81328467; Fri, 26 Nov 2010 10:25:02 -0500 (EST) Received: by leary.csoft.net (Postfix, from userid 1112) id CF36AAB11; Fri, 26 Nov 2010 10:25:01 -0500 (EST) Date: Fri, 26 Nov 2010 10:25:01 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: =?ISO-8859-2?Q?Rados=B3aw_Smogura?= cc: =?KOI8-R?B?4czFy9PBzsTf0iD7z9DP1w==?= , pgsql-jdbc@postgresql.org Subject: Re: Workarounds for getBinaryStream returning ByteArrayInputStream on bytea In-Reply-To: Message-ID: References: <1290631846.3659.9.camel@dalgonosko> <5cdf97054e76f67c40b74de114691762@smogura-softworks.eu> <1290639211.3659.15.camel@dalgonosko> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/113 X-Sequence-Number: 21234 On Fri, 26 Nov 2010, Rados?aw Smogura wrote: > I would like to send few files for getBinaryStream(). So this will work > much like stream and will don't eat so much heap. I don't copy source > this_row[i] array, so I don't know how this will do with concur updates, > (original method doesn't make this when column is not bytea, too). I left > few comments if we should throw exception on broken streams in 8.4, or just > silence notify EOF. The problem is that the whole bytea is still in this_row[i]. The value isn't being streamed from the server. So yes, you are saving a copy of the value which does save heap space, but that won't really help the described problem where many large bytea values are fetched because the driver will have read and stored them all prior to getBinaryStream being called. Kris Jurka