pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedDocumentation bug / oversight
2+ messages / 2 participants
[nested] [flat]
* Documentation bug / oversight
@ 2015-12-15 07:52 Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Kellerer @ 2015-12-15 07:52 UTC (permalink / raw)
To: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Documentation bug / oversight
@ 2015-12-15 14:26 Dave Cramer <pg@fastcrypt.com>
parent: Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Cramer @ 2015-12-15 14:26 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc
Thanks, I'll have a look!
Dave Cramer
davec@postgresintl.com
www.postgresintl.com
On 15 December 2015 at 02:52, Thomas Kellerer <spam_eater@gmx.net> wrote:
> 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
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-12-15 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-15 07:52 Documentation bug / oversight Thomas Kellerer <spam_eater@gmx.net>
2015-12-15 14:26 ` Dave Cramer <pg@fastcrypt.com>
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