-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: 'infinity'::time should be greater than any other time #129148
Copy link
Copy link
Open
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)X-blathers-triagedblathers was able to find an ownerblathers was able to find an owner
Description
In the current implementation, 'infinity'::time is equal to '23:59:59.999999' and smaller than '24:00:00'.
We should make it greater than any other time to fit the semantics of 'infinity', and the updated behaviour will also aligne with pr #127141
demo@127.0.0.1:26257/demoapp/movr> SELECT 'infinity'::time = '23:59:59.999999'::time;
?column?
------------
t
demo@127.0.0.1:26257/demoapp/movr> SELECT 'infinity'::time < '24:00:00'::time;
?column?
------------
t
Alternatively, we can align it's behaviour with postgres, which prohibits 'infinity'::time:
postgres=# SELECT 'infinity'::time;
ERROR: invalid input syntax for type time: "infinity"
LINE 1: SELECT 'infinity'::time;
^
postgres=# SELECT 'infinity'::time > '23:59:59.999999'::time;
ERROR: invalid input syntax for type time: "infinity"
LINE 1: SELECT 'infinity'::time > '23:59:59.999999'::time;
This issue complements issue #41564
Jira issue: CRDB-41399
Epic CRDB-60811
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)X-blathers-triagedblathers was able to find an ownerblathers was able to find an owner
Type
Projects
Status
Backlog