From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: "two time periods with only an endpoint in common do not overlap" ???
Date: Fri, 15 Oct 2021 10:01:20 -0400
Message-ID: <953559.1634306480@sss.pgh.pa.us> (raw)
In-Reply-To: <0782c52d-2a80-b37f-0b9e-1a2a7cfb68c5@gmail.com>
References: <820B633E-90C6-40F0-81A0-CAA074E5762F@yugabyte.com>
<2ff5f521-34ab-8690-180a-864441e4f15b@aklaver.com>
<0782c52d-2a80-b37f-0b9e-1a2a7cfb68c5@gmail.com>
Ron <ronljohnsonjr@gmail.com> writes:
> On 10/14/21 7:02 PM, Adrian Klaver wrote:
>> 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?
They don't. Per the fine manual [1]:
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. This means for instance that two
time periods with only an endpoint in common do not overlap.
regards, tom lane
[1] https://www.postgresql.org/docs/current/functions-datetime.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com
Subject: Re: "two time periods with only an endpoint in common do not overlap" ???
In-Reply-To: <953559.1634306480@sss.pgh.pa.us>
References: <820B633E-90C6-40F0-81A0-CAA074E5762F@yugabyte.com> <2ff5f521-34ab-8690-180a-864441e4f15b@aklaver.com> <0782c52d-2a80-b37f-0b9e-1a2a7cfb68c5@gmail.com> <953559.1634306480@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox