Skip to content

Conversation

vlsi
Copy link
Member

@vlsi vlsi commented Jan 24, 2025

At best, we should avoid byte[] -> String -> byte[] conversions when dealing with datetime, however, currently PgCallableStatement uses getObject eagerly, so we lose the underlying wire format byte[] early.

That is why we have to use .toString() when converting to date. Ideally, we should keep the source byte[] data and convert it on request.


The change avoids getBytes() with the default encoding. I believe, date-time use limited alphabet, so the encoding should not matter much. However, the use of the default encoding was not the best choice.

… to Date/Time/Timestamp

At best, we should avoid `byte[] -> String -> byte[]` conversions
when dealing with datetime, however, currently PgCallableStatement uses
getObject eagerly, so we lose the underlying wire format byte[] early.

That is why we have to use .toString() when converting to date.
Ideally, we should keep the source byte[] data and convert it on request.
@vlsi vlsi merged commit 882b97f into pgjdbc:master Jan 24, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant