Skip to content

Make sure to handle microsecond resolution as PostgreSQL does#1575

Merged
tsegismont merged 2 commits into
eclipse-vertx:masterfrom
tsegismont:issue/1165
Nov 19, 2025
Merged

Make sure to handle microsecond resolution as PostgreSQL does#1575
tsegismont merged 2 commits into
eclipse-vertx:masterfrom
tsegismont:issue/1165

Conversation

@tsegismont
Copy link
Copy Markdown
Member

Fixes #1165

PostgreSQL has microsecond resolution for timestamps. When converting from text, if the nanoseconds part after microseconds is strictly bigger than 499, PostgreSQL server rounds up to the next microsecond.

Fixes eclipse-vertx#1165

PostgreSQL has microsecond resolution for timestamps.
When converting from text, if the nanoseconds part after microseconds is strictly bigger than 499, PostgreSQL server rounds up to the next microsecond.

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
Copy link
Copy Markdown
Member Author

@DavideD would you mind to have a look? I think it should be fine for Hibernate Reactive but better safe than sorry :-)

@DavideD
Copy link
Copy Markdown
Contributor

DavideD commented Nov 18, 2025

ACK.
I will have a look as soon as I can.

Use the timestamp min/max values from PostgreSQL server

Then, it's safe to add microseconds to the computed timestamps because we're well under the limit of LocalDateTime.MAX

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont tsegismont merged commit 051ca23 into eclipse-vertx:master Nov 19, 2025
18 checks passed
@tsegismont tsegismont deleted the issue/1165 branch November 19, 2025 17:13
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.

PgClient Timestamps are encoded with microsecond resolution by truncation instead of by rounding

2 participants