Re: "two time periods with only an endpoint in common do not overlap" ???
От | Adrian Klaver |
---|---|
Тема | Re: "two time periods with only an endpoint in common do not overlap" ??? |
Дата | |
Msg-id | 98ea7ea3-38ac-d145-e668-803e5ea14de7@aklaver.com обсуждение исходный текст |
Ответ на | Re: "two time periods with only an endpoint in common do not overlap" ??? (Ron <ronljohnsonjr@gmail.com>) |
Ответы |
Re: "two time periods with only an endpoint in common do not overlap" ???
|
Список | pgsql-general |
On 10/15/21 06:52, Ron wrote: > On 10/14/21 7:02 PM, Adrian Klaver wrote: > [snip] >> or the third example in the docs: >> >> SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS >> (DATE '2001-10-30', DATE '2002-10-30'); >> Result: true >> SELECT (DATE '2001-02-16', INTERVAL '100 days') OVERLAPS >> (DATE '2001-10-30', DATE '2002-10-30'); >> Result: false >> SELECT (DATE '2001-10-29', DATE '2001-10-30') OVERLAPS >> (DATE '2001-10-30', DATE '2001-10-31'); >> Result: false > > Why /don't/ they overlap, given that they share a common date? Per the docs: https://www.postgresql.org/docs/current/functions-datetime.html " Each time period is considered to represent the half-open interval start <= time < end, unless start and end are equal in which case it represents that single time instant." Which I read as (DATE '2001-10-29', DATE '2001-10-30') ends at '2001-10-29' and (DATE '2001-10-30', DATE '2001-10-31') starts at DATE '2001-10-30' so no overlap. > > -- > Angular momentum makes the world go 'round. -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления: