I’m quoting this from “9.9. Date/Time Functions and Operators” in the PG Version 14 doc on the “overlaps” operator, here: It’s the same in “current”—and in the Version 11 doc.
I tried this obvious test (using Version 13.4): with c as ( select '2000-01-15'::timestamp as start_1, '2000-02-15'::timestamp as start_2, '2000-03-15'::timestamp as common_endpoint) select ( (start_1, common_endpoint) overlaps (start_2, common_endpoint) )::text from c; The result is "true". Seems to me that the doc is therefore wrong—not only as shown by this test but also w.r.t. what reasoning from the account at "half-open interval" says. Now consider this: with c as ( select '2000-01-15'::timestamp as start, '2000-02-15'::timestamp as common_touchpoint, '2000-03-15'::timestamp as endpoint) select ( (start, common_touchpoint) overlaps (common_touchpoint, endpoint) )::text from c; The result is now "false". As it seems to me this is correct w.r.t. what reasoning from the account at "half-open interval" says. It also seems to me that whenever the doc derives a predicted result from the stated rules, it's honor bound to substantiate this with a code example. |