Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B07891337B94 for ; Wed, 24 Nov 2010 18:53:42 -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 45563-02 for ; Wed, 24 Nov 2010 22:53:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.openintegra.com (mail.openintegra.com [193.68.120.3]) by mail.postgresql.org (Postfix) with ESMTP id 5B2F11337B39 for ; Wed, 24 Nov 2010 18:53:33 -0400 (AST) Received: from [10.142.89.106] (78-83-48-61.spectrumnet.bg [78.83.48.61]) (authenticated bits=0) by mail.openintegra.com (8.13.8/8.13.8) with ESMTP id oAOMrWgo019046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Nov 2010 00:53:33 +0200 Subject: Re: Workarounds for getBinaryStream returning ByteArrayInputStream on bytea From: =?UTF-8?Q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A=D1=80_?= =?UTF-8?Q?=D0=A8=D0=BE=D0=BF=D0=BE=D0=B2?= To: pgsql-jdbc@postgresql.org In-Reply-To: <5cdf97054e76f67c40b74de114691762@smogura-softworks.eu> References: <1290631846.3659.9.camel@dalgonosko> <5cdf97054e76f67c40b74de114691762@smogura-softworks.eu> Content-Type: text/plain; charset="UTF-8" Date: Thu, 25 Nov 2010 00:53:31 +0200 Message-ID: <1290639211.3659.15.camel@dalgonosko> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 (2.32.1-1.fc14) Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/88 X-Sequence-Number: 21209 В 16:04 -0600 на 24.11.2010 (ср), Radosław Smogura написа: > I see only two possibilities > 1. Decrease fetch size, e.g. to 1. Even if I do, bytea is potentially 1GB. Plus peaks in usage can still smash the heap. So refactoring to BLOBs is perhaps the only way out. Will the JDBC driver always present bytea InputStream as ByteArrayInputStream? No plans to change that? (even if there are, I will still have to refactor meanwhile). Perhaps this behaviour should be better communicated to DB schema designers. It seems to me from the Npgsql2.0.11 readme.txt that reading in chunks is provided for .Net. Is there need to perhaps make patches for this in the jdbc driver? Kind regards: al_shopov