pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sven Köhler <skoehler@upb.de>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: BLOBs etc
Date: Fri, 07 Jan 2005 04:48:16 +0100
Message-ID: <41DE0680.4030103@upb.de> (raw)
In-Reply-To: <Pine.BSO.4.56.0501062211370.25172@leary.csoft.net>
References: <crkrbc$t8c$1@sea.gmane.org>
	<Pine.BSO.4.56.0501062135090.10098@leary.csoft.net>
	<41DDFC46.1080807@upb.de>
	<Pine.BSO.4.56.0501062211370.25172@leary.csoft.net>

>>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?

Ohh, well. The "getInputStream/getBLOB/..." above was ment to include 
the set-Methods. After all you said, it seems reasonable not to 
impelement set/getBlob() for bytea.

On the other hand, it may lower compatibility of the JDBC driver to 
generic applications, if there is a datatype that either set/getBlob() 
or set/getBinaryStream() doesn't work for. So one should avoid using bytea.

But am i right that set/getBinaryStream won't work for oid columns? I 
think delegating set/getBinaryStream() to set/getBlob() is easy if the 
JDBC driver would know when to do it. Would that be possible? That would 
make oid columns the most compatible as thay would allow to use both: 
the binarystream methods and the blob methods. The compatibility of the 
JDBC could be improved by that.



view thread (23+ messages)  latest in thread

Message-ID: <41DE0680.4030103@upb.de>
Permalink:  ../41DE0680.4030103@upb.de/
Also on:    postgresql.org/message-id/41DE0680.4030103@upb.de

 · 

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: skoehler@upb.de, books@ejurka.com
  Subject: Re: BLOBs etc
  In-Reply-To: <41DE0680.4030103@upb.de>
  References: <crkrbc$t8c$1@sea.gmane.org> <Pine.BSO.4.56.0501062135090.10098@leary.csoft.net> <41DDFC46.1080807@upb.de> <Pine.BSO.4.56.0501062211370.25172@leary.csoft.net> <41DE0680.4030103@upb.de>

* 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