Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8ODY-0001dg-Jr for pgsql-jdbc@arkaria.postgresql.org; Wed, 29 Jan 2014 06:01:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W8ODX-0003oY-VL for pgsql-jdbc@arkaria.postgresql.org; Wed, 29 Jan 2014 06:01:44 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8ODX-0003oS-9U for pgsql-jdbc@postgresql.org; Wed, 29 Jan 2014 06:01:43 +0000 Received: from outmail148112.authsmtp.co.uk ([62.13.148.112]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8ODU-0005dm-Si for pgsql-jdbc@postgresql.org; Wed, 29 Jan 2014 06:01:42 +0000 Received: from mail-c235.authsmtp.com (mail-c235.authsmtp.com [62.13.128.235]) by punt17.authsmtp.com (8.14.2/8.14.2/) with ESMTP id s0T61XSx004760; Wed, 29 Jan 2014 06:01:33 GMT Received: from ayaki.localdomain (124-169-97-77.dyn.iinet.net.au [124.169.97.77]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id s0T61Pfo034753 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 29 Jan 2014 06:01:28 GMT Message-ID: <52E89934.5010102@2ndquadrant.com> Date: Wed, 29 Jan 2014 14:01:24 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Andreas Joseph Krogh , pgsql-jdbc@postgresql.org Subject: Re: Will Connection.createBlob be implemented any time soon? References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Server-Quench: cc009112-88aa-11e3-b802-002590a15da7 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFagxbZ1hf HGQLWlBEUFt7WWJ/ aQMfbAdZfEtIVhtj V1ZORU1QEQdtHh1P RR56VBgSIVpGe3p3 YEUsWHJSWAopJkZ9 S09VF3AObTYxdWEe BUNFJQtUch5Kfh1A Y1AuVXZZMGJJBC9q VzwRExoaCH1gKSBR CioKK1QfSloKGTh6 TAoPFCkiN0kCTW05 IlQnL0YYEUMcNFk/ PRMoX0NQLx4XB0VF GEZLV0c/ X-Authentic-SMTP: 61633235383639.1023:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.169.97.77/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On 01/28/2014 05:29 PM, Andreas Joseph Krogh wrote: > Read it again, it does use streaming. It copies the "is" stream out to > the "os" stream, backed by the Blob. Sure, but if it's backed by a 'bytea' column the scenes PgJDBC still reads the whole thing into memory before sending it off (for output), or reads the whole blob from the PostgreSQL database connection before exposing it to the client (for input). PostgreSQL supports streaming for pg_largeobject, i.e. the "lob" type, but not for bytea. That doesn't mean you can't present a streaming interface to it, just that you don't get any benefit from doing so. > Using EclipseLink with the pgjdbc-ng driver it works perfectly using > Connection.createBlob, streaming etc. I've tried streaming > 200GB stuff > with a Blob field in a JPA-object and it works. Is the backing column "lob", or a pg_largeobject directly? This won't work with bytea, so it must be. > What pussles me is why the "official" driver doesn't implement > createBlob as I thought it should be a quit common use-case to want to > stream large data-chunks in the db (for tx-purposes). Because nobody's wanted it enough to implement it yet. There are lots of areas where PgJDBC could be better, but nobody who's had the time has also had the inclination to do the work required to make it happen. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc