pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Dobes <dobesv@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setBlob() copies the blob, even it was already a PostgreSQL blob!
Date: Fri, 28 May 2010 14:52:40 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1005281440030.30913@leary.csoft.net> (raw)
In-Reply-To: <e112f747-7bf4-410d-8efb-fbf90e508875@v12g2000prb.googlegroups.com>
References: <e112f747-7bf4-410d-8efb-fbf90e508875@v12g2000prb.googlegroups.com>



On Thu, 27 May 2010, Dobes wrote:

> Looking at org.postgresql.jdbc2.AbstractJdbc2Statement.setBlob(int,
> Blob) it seems to copy the given blob, even if the blob was already a
> PostgreSQL blob.

Just knowing it's a postgresql blob isn't enough.  You could have fetched 
that blob from another connection to another database on another server. 
So at minimum you'd need to know the blob was retrieved from the same 
connection.  It's also not clear that you never want to copy the blob. 
It's really a pain how PG requires you to manually garbage collect your 
blobs, so your strategy for doing that impacts whether you want to copy or 
not.

Certainly once we get Connection.createBlob to work we don't want to have 
two copies of that, so we'll need some sort of fix at some point, but it's 
not clear to me that never copying is the answer.

Kris Jurka



view thread (2+ messages)

Message-ID: <alpine.BSO.2.00.1005281440030.30913@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1005281440030.30913@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1005281440030.30913@leary.csoft.net

 · 

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: books@ejurka.com, dobesv@gmail.com
  Subject: Re: setBlob() copies the blob, even it was already a PostgreSQL blob!
  In-Reply-To: <alpine.BSO.2.00.1005281440030.30913@leary.csoft.net>
  References: <e112f747-7bf4-410d-8efb-fbf90e508875@v12g2000prb.googlegroups.com> <alpine.BSO.2.00.1005281440030.30913@leary.csoft.net>

* 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