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

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Will Connection.createBlob be implemented any time soon?
Дата
Msg-id 52E89934.5010102@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Will Connection.createBlob be implemented any time soon?  (Andreas Joseph Krogh <andreak@officenet.no>)
Ответы Re: Will Connection.createBlob be implemented any time soon?  (Andreas Joseph Krogh <andreak@officenet.no>)
Список pgsql-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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Will Connection.createBlob be implemented any time soon?
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: Will Connection.createBlob be implemented any time soon?