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 F2F5F529EB for ; Tue, 28 Jun 2005 10:06:17 -0300 (ADT) 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 22278-07 for ; Tue, 28 Jun 2005 13:06:16 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id C41875295C for ; Tue, 28 Jun 2005 10:06:12 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DnFn4-0005FW-UI; Wed, 29 Jun 2005 01:06:15 +1200 Message-ID: <42C14B45.8000500@opencloud.com> Date: Wed, 29 Jun 2005 01:06:13 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jesper Thorhauge Cc: pgsql-jdbc@postgresql.org Subject: Re: getBinaryStream and OutOfMemoryException References: <42C10723.5010702@conzentrate.com> In-Reply-To: <42C10723.5010702@conzentrate.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/139 X-Sequence-Number: 13101 Jesper Thorhauge wrote: > Looking into the cvs > checkout from > 22-05-2005, it really seems to me that getBinaryStream is nothing more > than a > getBytes ...?? Correct. The current frontend/backend protocol doesn't really let us do this differently, at least for bytea columns. It could be made more memory-efficient (e.g. by using the binary result format rather than the current text format) but the driver still has to pull the entire column value across the wire at the time the row is returned. Another approach would be to write large column values to disk, but noone's written the code to do that yet; it also has some other problems such as: what if you are running in an environment where you don't have access to the disk? -O