Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5153A634EF2 for ; Thu, 21 Jan 2010 11:21:07 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67793-10 for ; Thu, 21 Jan 2010 15:20:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id E35DA632B2A for ; Thu, 21 Jan 2010 11:20:56 -0400 (AST) Received: by leary.csoft.net (Postfix, from userid 1112) id 1C53AA38B; Thu, 21 Jan 2010 10:20:54 -0500 (EST) Date: Thu, 21 Jan 2010 10:20:53 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: "Satish Burnwal (sburnwal)" cc: Heikki Linnakangas , pgsql-jdbc@postgresql.org Subject: Re: How to use JDBC to update LargeObject In-Reply-To: <3A8C969225424C4D8E6BEE65ED8552DA89D6E5@XMB-BGL-41C.cisco.com> Message-ID: References: <3A8C969225424C4D8E6BEE65ED8552DA89D653@XMB-BGL-41C.cisco.com> <4B5808C5.4050906@enterprisedb.com> <3A8C969225424C4D8E6BEE65ED8552DA89D6E5@XMB-BGL-41C.cisco.com> 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=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/62 X-Sequence-Number: 20258 On Thu, 21 Jan 2010, Satish Burnwal (sburnwal) wrote: > Even setBlob() method seems to be updating large object only partially. If you want to reuse an existing blob you need to truncate it first: http://java.sun.com/javase/6/docs/api/java/sql/Blob.html#truncate(long) Note that there is a bug with truncate in all but the CVS JDBC drivers that prevents you from truncating a blob to zero length. Released drivers can only truncate down to one byte, but that's probably fine for you at the moment. Kris Jurka