Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8RIV-0007zx-2y for pgsql-jdbc@arkaria.postgresql.org; Wed, 29 Jan 2014 09:19:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W8RIU-0000RP-DX for pgsql-jdbc@arkaria.postgresql.org; Wed, 29 Jan 2014 09:19:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8RIT-0000Qc-IF for pgsql-jdbc@postgresql.org; Wed, 29 Jan 2014 09:19:01 +0000 Received: from prod2.officenet.no ([195.159.87.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8RIQ-0001fY-OF for pgsql-jdbc@postgresql.org; Wed, 29 Jan 2014 09:19:01 +0000 Received: from localhost ([127.0.0.1] helo=prod2) by prod2.officenet.no with esmtp (Exim 4.76) (envelope-from ) id 1W8RIN-00087B-4Y for pgsql-jdbc@postgresql.org; Wed, 29 Jan 2014 10:18:56 +0100 Date: Wed, 29 Jan 2014 10:18:38 +0100 (CET) From: Andreas Joseph Krogh To: pgsql-jdbc@postgresql.org Message-ID: In-Reply-To: <52E89934.5010102@2ndquadrant.com> Subject: Re: Will Connection.createBlob be implemented any time soon? MIME-Version: 1.0 X-Mailer: OfficeNet Mail 1.9.0-SNAPSHOT X-Pg-Spam-Score: -2.4 (--) Content-Type: multipart/alternative; boundary="----=_Part_147_1566862569.1390987118696" 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 ------=_Part_145_1799646861.1390987118679 Content-Type: multipart/related; boundary="----=_Part_146_1505108479.1390987118679" ------=_Part_146_1505108479.1390987118679 Content-Type: multipart/alternative; boundary="----=_Part_147_1566862569.1390987118696" ------=_Part_147_1566862569.1390987118696 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable P=C3=A5 onsdag 29. januar 2014 kl. 07:01:24, skrev Craig Ringer < craig@2ndquadrant.com >: On 01/28/2014 05:29 = PM,=20 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. =C2=A0 Yes it's backed by a column-type=3D= IOD =C2=A0 >=20 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. =C2=A0 =C2=A0 This official driver has served users and de= velopers well=20 for many year and all credit to it's developers. That said it clarely isn't= =20 being actively developed anymore and suggestions for new features often end= up=20 in /dev/null, which I understand completely when nobody works on the driver= . =C2=A0=20 -- Andreas Joseph Krogh =C2=A0 =C2=A0 =C2=A0 mob: +47 9= 09 56 963 Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no Public key: http://home.officenet.no/~andreak/public_key.asc =C2=A0 ------=_Part_147_1566862569.1390987118696 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable
P=C3=A5 onsdag 29. januar 2014 kl. 07:01:24, skrev Craig Ringer <craig@2ndquadrant.= com>:
On = 01/28/2014 05:29 PM, Andreas Joseph Krogh wrote:
> Read it again, it does use streaming. It copies the "is" str= eam 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 w= on't
work with bytea, so it must be.
=C2= =A0
Yes= it's backed by a column-type=3DIOD
=C2= =A0
>= ; What pussles me is why the "official" driver doesn't implement<= br> > 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.
=C2=A0
=C2=A0
This official driver has served users and developers well for many yea= r and all credit to it's developers. That said it clarely isn't being activ= ely developed anymore and suggestions for new features often end up in /dev= /null, which I understand completely when nobody works on the driver.
=C2=A0
--
Andreas Joseph Krogh <andreak@officenet.no>=C2=A0 =C2=A0 =C2=A0 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
=C2=A0
------=_Part_147_1566862569.1390987118696-- ------=_Part_146_1505108479.1390987118679-- ------=_Part_145_1799646861.1390987118679--