Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbNm3-00055f-IA for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 14:01:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbNm1-0002Lj-Ef for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 14:01:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbNm1-0002La-4y for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 14:01:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbNly-0007XF-Kz for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 14:01:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19FE1KPi953560; Fri, 15 Oct 2021 10:01:20 -0400 From: Tom Lane To: Ron cc: pgsql-general@lists.postgresql.org Subject: Re: "two time periods with only an endpoint in common do not overlap" ??? 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> Comments: In-reply-to Ron message dated "Fri, 15 Oct 2021 08:52:40 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <953558.1634306480.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 15 Oct 2021 10:01:20 -0400 Message-ID: <953559.1634306480@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron 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