pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@2ndquadrant.com>
To: Andreas Joseph Krogh <andreak@officenet.no>
To: pgsql-jdbc@postgresql.org
Subject: Re: Will Connection.createBlob be implemented any time soon?
Date: Wed, 29 Jan 2014 14:01:24 +0800
Message-ID: <52E89934.5010102@2ndquadrant.com> (raw)
In-Reply-To: <OfficeNetEmail.28.ad1b78759a3d318e.143d828e98e@prod2>
References: <OfficeNetEmail.28.ad1b78759a3d318e.143d828e98e@prod2>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

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



view thread (18+ messages)  latest in thread

Message-ID: <52E89934.5010102@2ndquadrant.com>
Permalink:  ../52E89934.5010102@2ndquadrant.com/
Also on:    postgresql.org/message-id/52E89934.5010102@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: craig@2ndquadrant.com, andreak@officenet.no
  Subject: Re: Will Connection.createBlob be implemented any time soon?
  In-Reply-To: <52E89934.5010102@2ndquadrant.com>
  References: <OfficeNetEmail.28.ad1b78759a3d318e.143d828e98e@prod2> <52E89934.5010102@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox