Re: BLOBs etc

From: Kris Jurka <books(at)ejurka(dot)com>
To: Sven Köhler <skoehler(at)upb(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: BLOBs etc
Date: 2005-01-07 03:19:09
Message-ID: Pine.BSO.4.56.0501062211370.25172@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, 7 Jan 2005, [ISO-8859-15] Sven Khler wrote:

> >>on the jdbc-webpages it says, that the JDBC team may decide to change
> >>getBLOBG/setBLOB to support bytea only, and that one should use the
> >>PostGreSQL specific LargeObject extension to acces them.
> >
> > I'm not sure where it says that, but it is either out of date or just
> > plain bad advice. If you could point out where it says that I'd
> > appreciate it. I would stick withe the standard Blob interface for now.
>
> http://www.postgresql.org/docs/7.4/static/jdbc-binary-data.html

The 7.4 docs do not really get updated any more, but I will make a change
to this in the 8.0 docs. Thanks.

> BTW: why don't getInputStream/getBLOB/... work for _both_, bytea and
> oid? Shouldn't the JDBC driver be abled to determine the used datatype
> and act accordingly? I'm sure you had you reasons. I'd just like to know
> them.
>

It certainly could do that. I'm guessing that it wasn't done to
maintain symmetry with the set methods, knowing that only one can
work. Making getInputStream work on oid would be easy, but making
getBlob work on bytea would be more work to write a wrapper. There is
also no real reason to use getBlob on bytea because no streaming is
supported.

Do you think the increased flexiblity is worth the potential for
confusion when the corresponding set method doesn't work?

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sven Köhler 2005-01-07 03:48:16 Re: BLOBs etc
Previous Message Sven Köhler 2005-01-07 03:04:38 Re: BLOBs etc