MaterializeInc / materialize

The Cloud Operational Data Store: use SQL to transform, deliver, and act on fast-changing data.
https://materialize.com
Other
5.72k stars 466 forks source link

Timestamp/Time min/max inconsistencies #20311

Open def- opened 1 year ago

def- commented 1 year ago

What version of Materialize are you using?

27e6fa5ae2496aae262ba2a58f2c373a73e50cb8

What is the issue?

materialize=> select TIME '23:59:60.';
    time
------------
 23:59:60.1
(1 row)

This works, but the documentation claims it goes only to 23:59:59: https://materialize.com/docs/sql/types/time/

materialize=> select TIMESTAMP '95143-12-31 23:59:59' + INTERVAL '167 MILLENNIUM';
       ?column?
-----------------------
 262143-12-31 23:59:59
(1 row)
materialize=> select TIMESTAMP '95144-12-31 23:59:59' + INTERVAL '167 MILLENNIUM';
ERROR:  timestamp out of range

This timestamp doesn't work, but should according to the documentation: https://materialize.com/docs/sql/types/timestamp/ since it's smaller than 294276 AD.

jkosh44 commented 1 year ago

Here are the same results in PostgreSQL:

postgres=# SELECT TIMESTAMP '95144-12-31 23:59:59' + INTERVAL '167 MILLENNIUM';
       ?column?        
-----------------------
 262144-12-31 23:59:59
(1 row)

postgres=# SELECT TIME '23:59:60.';
   time   
----------
 24:00:00
(1 row)