Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Error when storing BC dates (e.g. "0000-12-31T01:01:00Z") #578

Copy link
Copy link
@mwinkels-bol

Description

@mwinkels-bol
Issue body actions

Bug Report

When storing a date that is BC (Before Christ) an error is thrown.

Versions

  • Driver: 0.9.3.RELEASE
  • Database: 12.11 / 13.3
  • Java: 17
  • OS: MacOS / Ubuntu

Current Behavior

A date that is BC (e.g. Year 0) will throw an error e.g. [22008] date/time field value out of range: "0000-12-31T01:01:00Z"
The driver is using Instant::toString for conversion, but this ignores the ERA (BC) and the database does not accept this as a value.
PostgreSQL can properly store these dates, but the driver implementation now prevents users from inserting it.

Steps to reproduce

As part of AbstractCodecIntegrationTests

testCodec(Instant.class, Instant.parse("0000-12-31T01:01:00Z"), "TIMESTAMPTZ");

Expected behavior/code

Dates BC should also be inserted by the driver.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.