Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id E43C86328FB for ; Thu, 14 Jan 2010 21:27:33 -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 14283-06 for ; Fri, 15 Jan 2010 01:27:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-px0-f194.google.com (mail-px0-f194.google.com [209.85.216.194]) by mail.postgresql.org (Postfix) with ESMTP id 3D68E6325F4 for ; Thu, 14 Jan 2010 21:27:23 -0400 (AST) Received: by pxi32 with SMTP id 32so141067pxi.15 for ; Thu, 14 Jan 2010 17:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=f87F4Zn04D4u1ZyzRR0KHwFrJ8U1T+cFqtdENAxQLHU=; b=Z+FXCifmo4ABX0g/5thw0706HU5O06E9pjeKZmQkfh9TNO3D8YQZBBgP988nNpx4xB kLVC3zyfw4Z9Ch6ytTHXSDhfhbQytbpEHQ/qF6KPMZvuw8Nl9RXhvrMfQhdGMbzxGIt/ 8kt5e0Izf/imWtaMuw2fAIoiMBlbsPWeijH30= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Gx0wWEyA3+BuNyXp/IPjR81NY+xStfIzgZMQrLjc92vJLNTeEViF+rKGuD12lb8tln z/qeF24l8/q5IXtQktn4JPJLXwwJwRMmLIjCnw1YxUHIJA2mLF05qRTUPOMxh0p6kwrt fFRqcFvgwE4yB/u9/nEhU2VLq79wuFehQgX6A= MIME-Version: 1.0 Received: by 10.115.100.13 with SMTP id c13mr1125600wam.65.1263518841348; Thu, 14 Jan 2010 17:27:21 -0800 (PST) Date: Fri, 15 Jan 2010 12:27:21 +1100 Message-ID: <82fa66381001141727l36ea4936g445e0c0ca7592f3e@mail.gmail.com> Subject: Bug in AbstractJdbc2BlobClob From: SJ Kissane To: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016e64d93c0b4a24b047d29e7a5 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.59 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/20 X-Sequence-Number: 20216 --0016e64d93c0b4a24b047d29e7a5 Content-Type: text/plain; charset=ISO-8859-1 Hi everyone I'm using JDBC4 Postgresql Driver, Version 8.4-701. Using pgJDBC, if you call clob.truncate(0) to truncate a clob to zero-length, you get a "org.postgresql.util.PSQLException: LOB positioning offsets start at 1". This is spurious -- the argument to truncate is not a position offset, its a length. So although position offsets must start at 1, lengths can start at 0. I see there is a call to assertPosition(len) -- that needs to go, maybe replace with a new assertLength(len)? (I am not on list so please reply direct; I hope this gets through to you though...) Cheers Simon --0016e64d93c0b4a24b047d29e7a5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi everyone

I'm using JDBC4 Postgresql Driver, Version 8.4-701. =

Using pgJDBC, if you call clob.truncate(0) to truncate a clob to ze= ro-length, you get a "org.postgresql.util.PSQLException: LOB positioni= ng offsets start at 1".
This is spurious -- the argument to truncate is not a position offset, its = a length. So although position offsets must start at 1, lengths can start a= t 0.
I see there is a call to assertPosition(len) -- that needs to go, m= aybe replace with a new assertLength(len)?

(I am not on list so please reply direct; I hope this gets through to y= ou though...)

Cheers
Simon
--0016e64d93c0b4a24b047d29e7a5--