PostgreSQL – Understanding OVERLAP Function with Interval

datetimepostgresql

On postgresql documentation whilst reading for date and time operations I have hard time understanding the following example:

SELECT (DATE '2001-02-16', INTERVAL '100 days') OVERLAPS
       (DATE '2001-10-30', DATE '2002-10-30');
Result: false

I failed to understand the reason why it returns false, is it because an Interval is being passed as a parameter?

Best Answer

As far as I understand it, (DATE '2001-02-16', INTERVAL '100 days') is evaluated as (DATE '2001-02-16', DATE '2001-02-16' + INTERVAL '100 days')

Which in turn is the same as (DATE '2001-02-16', DATE '2001-05-27') and that obviously doesn't overlap with (DATE '2001-10-30', DATE '2002-10-30')