Skip to content

infinity value in Postgres timestamp column returns as 'Invalid Date' #728

Closed

Description

@hanszoons

I have a table with a column dat has a date field with a default value of infinity.

CREATE TABLE test (
  id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
  expires timestamp with time zone DEFAULT 'infinity' NOT NULL,
  PRIMARY KEY (id),
);

This works fine within postgres and within query logic, e.g. ... WHERE end_date is > now() to select all rows that are not yet expired. But Postgres.js converts the infinity values to a Date, resulting in an 'Invalid Date' object in javascript.

Shouldn't this be converted to JavaScripts'Infinity? Should i make a custom type (but I need to replicate the existing date conversion somehow too)? How would I approach this?

Activity

  1. BeeFox-sys commented on Feb 18, 2024

    @BeeFox-sys

    I am also having this issue

  2. added a commit that references this issue on Oct 29, 2026
    06cf284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions