pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
9+ messages / 4 participants
[nested] [flat]

* [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-12 10:20  "davecramer (@davecramer)" <[email protected]>
  0 siblings, 0 replies; 9+ messages in thread

From: davecramer (@davecramer) @ 2025-08-12 10:20 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

One thing.

Do we really want to allow whitespace in the hex encoded parameter?

Also fixed the error message which had an `'` in it which stopped MessageFormat from formatting the message properly

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-12 12:30  "vlsi (@vlsi)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

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

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

This defeats Netty's approach. `Character.MAX_VALUE + 1` was vital there.
If you use `[256]`, then the reference to `Netty` is misleading.

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-12 12:32  "vlsi (@vlsi)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

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

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

"netty" has nothing to do with whitespace

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-12 12:32  "vlsi (@vlsi)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

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

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

I don't think it makes sense adding chars one by one

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-12 12:33  "vlsi (@vlsi)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

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

(on pgjdbc/src/test/java/org/postgresql/util/PGbyteaTest.java)

Can the tests be parameterized?

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-13 14:14  "austb (@austb)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

From: austb (@austb) @ 2025-08-13 14:14 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

I don't think the whitespace handling is necessary, folks could always construct their strings to not have whitespace, but it is part of what postgresql allows in its queries, so if this wants to support any query it would need to.
```
select '\x AA BB CC'::bytea;
  bytea   
----------
 \xaabbcc
(1 row)
```

https://www.postgresql.org/docs/17/datatype-binary.html#DATATYPE-BINARY-BYTEA-HEX-FORMAT

> For input, the hexadecimal digits can be either upper or lower case, and whitespace is permitted between digit pairs (but not within a digit pair nor in the starting \x sequence). 

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-08-13 14:37  "vlsi (@vlsi)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

From: vlsi (@vlsi) @ 2025-08-13 14:37 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

> I don't think the whitespace handling is necessary, folks could always construct their strings to not have whitespace

There might be an application (or library) that generates literals with whitespaces. As PostgreSQL accepts literals with whitespaces, we should be doing so.

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2025-09-20 14:20  "austb (@austb)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

From: austb (@austb) @ 2025-09-20 14:20 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Just thought I'd check in and see if there's anything I can do to help move this PR along. I think it might have just fallen off the top of the pile, but let me know if I can do anything to help, thank you!

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

* Re: [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter
@ 2026-01-05 22:00  "corporate-gadfly (@corporate-gadfly)" <[email protected]>
  7 siblings, 0 replies; 9+ messages in thread

From: corporate-gadfly (@corporate-gadfly) @ 2026-01-05 22:00 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

Adding a link to the issue.

* Fixes #3757 

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


end of thread, other threads:[~2026-01-05 22:00 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-12 10:20 [pgjdbc/pgjdbc] PR #3760: fix: Issue #3757 PreparedStatement.toString fails for hex encoded bytea parameter "davecramer (@davecramer)" <[email protected]>
2025-08-12 12:30 ` "vlsi (@vlsi)" <[email protected]>
2025-08-12 12:32 ` "vlsi (@vlsi)" <[email protected]>
2025-08-12 12:32 ` "vlsi (@vlsi)" <[email protected]>
2025-08-12 12:33 ` "vlsi (@vlsi)" <[email protected]>
2025-08-13 14:14 ` "austb (@austb)" <[email protected]>
2025-08-13 14:37 ` "vlsi (@vlsi)" <[email protected]>
2025-09-20 14:20 ` "austb (@austb)" <[email protected]>
2026-01-05 22:00 ` "corporate-gadfly (@corporate-gadfly)" <[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