Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a8kQ7-0002GH-Vv for pgsql-jdbc@arkaria.postgresql.org; Tue, 15 Dec 2015 07:53:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a8kQ6-0007ak-S1 for pgsql-jdbc@arkaria.postgresql.org; Tue, 15 Dec 2015 07:53:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a8kPb-00072h-T4 for pgsql-jdbc@postgresql.org; Tue, 15 Dec 2015 07:52:44 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a8kPU-0002OU-7h for pgsql-jdbc@postgresql.org; Tue, 15 Dec 2015 07:52:42 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a8kPQ-0003h0-Hh for pgsql-jdbc@postgresql.org; Tue, 15 Dec 2015 08:52:32 +0100 Received: from 185.40.248.10 ([185.40.248.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Dec 2015 08:52:32 +0100 Received: from spam_eater by 185.40.248.10 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Dec 2015 08:52:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Documentation bug / oversight Date: Tue, 15 Dec 2015 08:52:23 +0100 Lines: 19 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 185.40.248.10 X-Mozilla-News-Host: news://news.gmane.org:119 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 X-Pg-Spam-Score: -0.4 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org The Postgres JDBC documentation regarding the use of setBinaryStream() for bytea columns states[1]: The length parameter to setBinaryStream must be correct. There is no way to indicate that the stream is of unknown length. If you are in this situation, you must read the stream yourself into temporary storage and determine the length. I think this is no longer correct. Build 1200 introduced the ability to do just that[2]: * Support for setBinaryStream with unknown length https://github.com/pgjdbc/pgjdbc/pull/220 My tests have shown that setBinaryStream(int, InputStream) indeed works just fine (as expected from the release notes) Regards Thomas [1] https://jdbc.postgresql.org/documentation/94/binary-data.html#binary-data-example [2] https://jdbc.postgresql.org/documentation/changelog.html#version_9.4-1200 -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc