Skip to content

Row to Json conversion may prevent reading a timestamp as Instant #1323

@keksipurkki

Description

@keksipurkki

Version

Vert.x 4.4.1 / PostgreSQL 15

Context

When a timestamp with time zone column is set to an ISO date value such as 2023-01-01, Vert.x PostgreSQL client returns the value as '2020-01-01T00:00Z'.

This is problematic since e.g. Java's Instant::parse requires an ISO 8601 timestamp with seconds included. Consequently, doing row.toJson().getInstant('created') fails with a DateTimeParseException.

Expected behavior: Ensure the returned timestamp includes seconds, i.e. '2020-01-01T00:00:00Z' in the above example.

Do you have a reproducer?

Here you go:
https://github.com/keksipurkki/vertx-db-timestamp-bug/tree/main

Steps to reproduce

  1. Clone the repository
  2. Build and run
  3. Observe that the demo query fails with a DateTimeParseException.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions