Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F3B8A633407 for ; Fri, 28 May 2010 15:52:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 22064-06 for ; Fri, 28 May 2010 18:52:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 023066327DE for ; Fri, 28 May 2010 15:52:42 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id A38672845C; Fri, 28 May 2010 14:52:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=mxTODYxFb3RSWQW7aOdXmMNBJUU=; b=Ac1bOl QaZI6E8jrhqiBz957nXO0fKDXgmBr9vt4ZocMfu03/KE5hwMWvYEzdy1q4YjkBW0 Z52p7q+HErxPbiSDnxw9YEACI9sR74B3B6AnONrrwFESsnPDTpj2elOTJPJCyVfv xiaRYFTb81J3e5n0iV7qWKazk5cvf0HHSnx5E= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 8778528459; Fri, 28 May 2010 14:52:40 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 5767BA428; Fri, 28 May 2010 14:52:40 -0400 (EDT) Date: Fri, 28 May 2010 14:52:40 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Dobes cc: pgsql-jdbc@postgresql.org Subject: Re: setBlob() copies the blob, even it was already a PostgreSQL blob! In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/85 X-Sequence-Number: 20569 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