pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
8+ messages / 2 participants
[nested] [flat]

* [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-08-29 11:48  "davecramer (@davecramer)" <[email protected]>
  0 siblings, 0 replies; 8+ messages in thread

From: davecramer (@davecramer) @ 2024-08-29 11:48 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

fixes Issue #3365 

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-08-29 12:03  "vlsi (@vlsi)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: vlsi (@vlsi) @ 2024-08-29 12:03 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

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


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-09-11 10:59  "davecramer (@davecramer)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: davecramer (@davecramer) @ 2024-09-11 10:59 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

@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 ?

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-09-11 18:46  "vlsi (@vlsi)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: vlsi (@vlsi) @ 2024-09-11 18:46 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

(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.

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-09-11 18:52  "davecramer (@davecramer)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: davecramer (@davecramer) @ 2024-09-11 18:52 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

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

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?

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-09-11 19:21  "vlsi (@vlsi)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: vlsi (@vlsi) @ 2024-09-11 19:21 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

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

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

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2024-09-11 19:26  "davecramer (@davecramer)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: davecramer (@davecramer) @ 2024-09-11 19:26 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

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

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

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array
@ 2025-05-16 11:52  "vlsi (@vlsi)" <[email protected]>
  6 siblings, 0 replies; 8+ messages in thread

From: vlsi (@vlsi) @ 2025-05-16 11:52 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

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

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2025-05-16 11:52 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-08-29 11:48 [pgjdbc/pgjdbc] PR #3368: fix: Output ? for bytea parameter instead of outputing the contents of the byte array "davecramer (@davecramer)" <[email protected]>
2024-08-29 12:03 ` "vlsi (@vlsi)" <[email protected]>
2024-09-11 10:59 ` "davecramer (@davecramer)" <[email protected]>
2024-09-11 18:46 ` "vlsi (@vlsi)" <[email protected]>
2024-09-11 18:52 ` "davecramer (@davecramer)" <[email protected]>
2024-09-11 19:21 ` "vlsi (@vlsi)" <[email protected]>
2024-09-11 19:26 ` "davecramer (@davecramer)" <[email protected]>
2025-05-16 11:52 ` "vlsi (@vlsi)" <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox