Created
July 9, 2015 11:54
-
-
Save franckverrot/cbceac4051a0c8938a90 to your computer and use it in GitHub Desktop.
PostgreSQL OVERLAPS function and infinity timestamps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ]-inf;today[ overlaps [today,+inf[ | |
# select ('-infinity'::timestamp, now()) overlaps (now(), 'infinity'::timestamp) ; | |
overlaps | |
---------- | |
f | |
(1 row) | |
-- ]-inf;tomorrow[ overlaps [today,+inf[ | |
# select ('-infinity'::timestamp, now() + interval '1 day') overlaps (now(), 'infinity'::timestamp) ; | |
overlaps | |
---------- | |
t | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment