Re: Will Connection.createBlob be implemented any time soon?

From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Will Connection.createBlob be implemented any time soon?
Date: 2014-01-29 09:18:38
Message-ID: OfficeNetEmail.b0.983c500c2c1403b6.143dd457b90@prod2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

På onsdag 29. januar 2014 kl. 07:01:24, skrev Craig Ringer <
craig(at)2ndquadrant(dot)com <mailto:craig(at)2ndquadrant(dot)com>>: 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.   Yes it's backed by a column-type=IOD   >
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.     This official driver has served users and developers well
for many year and all credit to it's developers. That said it clarely isn't
being actively developed anymore and suggestions for new features often end up
in /dev/null, which I understand completely when nobody works on the driver.  
--
Andreas Joseph Krogh <andreak(at)officenet(dot)no>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc  

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2014-01-29 11:45:30 Re: Will Connection.createBlob be implemented any time soon?
Previous Message Andreas Joseph Krogh 2014-01-29 09:12:45 Re: Will Connection.createBlob be implemented any time soon?