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?
I have a table with a column dat has a date field with a default value of infinity.
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?