Subject: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 29 Aug 2024 11:48:27 +0000

fixes Issue #3365

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Thu, 29 Aug 2024 12:03:17 +0000

This change will break sending streams in simple query mode. I guess we
need to make this conditional and emit the stream in case it actually sends
a simple query

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 11 Sep 2024 10:59:01 +0000

@vlsi so the current code will execute the statement in SimpleQuery mode but any subsequent attempt to execute toString() will fail. One option is to reset the InputStream after using it. 
Thoughts ?

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 11 Sep 2024 18:46:14 +0000

(on pgjdbc/src/main/java/org/postgresql/util/PGbytea.java:189)

The stream might not support mark/reset, so this workaround does not look reliable.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 11 Sep 2024 18:52:29 +0000

So the alternative would be to read the stream into a buffer. I'm not a fan of that. I'm sort of willing to leave this as a half-baked work around.
Do you have any other suggestions?

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Wed, 11 Sep 2024 19:21:04 +0000

`mark(max_value)` in most of the cases buffers the data in memory :-/

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 11 Sep 2024 19:26:57 +0000

works well for `ByteArrayInputStream` what I am worried about is a FileInputStream that could potentially blow up the client.

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Fri, 16 May 2025 11:52:05 +0000

Closing in favour of https://github.com/pgjdbc/pgjdbc/pull/3369