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 1mbNju-0004w4-Dk for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 13:59:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbNjt-0006YC-7r for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 13:59:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbNjs-0006Y1-70 for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 13:59:12 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbNjj-0006eo-W3 for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 13:59:11 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D84CF5C01C2; Fri, 15 Oct 2021 09:59:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 15 Oct 2021 09:59:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:mime-version:subject:to:references:from :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=E 7dSyDZ/15Z9PkwAAk8Rzhu8dvlJERqy6auEV5F9hzo=; b=Q6bVDj6r//fNuN09A szw9FBWTUZXTN4i5QiDge4WuxIYUsEsDPb+ijQZ9b4wM9AAEdyF/oV21RJkKJ5Rx su318ghv/QVHMjLuZI1IkbSYNX++qFZDtfeobreHGLTa0Q7wJRDO7h5PsMFvKEMp 9NzuwlNyFP02d1VifwQF0F4+8ln5oj2/UfcK+tacOJGAbChu3FcZ0GoMThWIArMK PJXvDDpsqHofOpniXwnbi3a7q7ARrp0+6LfkjsM1xdredVDHBLVsN0VRcndCbBGt p/a7uMARq0V7xonEW9jMb1L07+2Fxv5ZJNra9AlIzvDxwQzmm7TKYbS65P4vvJPl zBW5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=E7dSyDZ/15Z9PkwAAk8Rzhu8dvlJERqy6auEV5F9h zo=; b=XleELNzxqHwOSheOOQxfEUACt5a3bZaf2i8WDQfpoodklJ3D3InMJ5BHP jhe6AvO/EPdxDTpo30ibOn3C6fKc7aY9+FwPyDiAeEhsN3D6rJEc4NRuaPFlZLpg 371VARkxf0BGevaAQKQgRid3LBM6861FcjAB1s39TwcM2Fk8aOJcYuV8c7QAv6TB RN5le+6qoAQOH5QtReDEXomdWDqGHnQR88U1ftGnNdYyB8WQEdFcDTZl/X4ygazA hzR4uJNTELnhLqWGeFVVsk/mkOVZenVV3WUWwOHXLnhjp4gyq33IQH0IW57ubnE6 IlepCt3yPkxOiLchvyIgRTiINLfjw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddugedgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepleekgeejhf ekteehfeduveetheeivdduheekudelteefvdffueehtddvgedtfeefnecuffhomhgrihhn pehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgt ohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Oct 2021 09:59:02 -0400 (EDT) Message-ID: <98ea7ea3-38ac-d145-e668-803e5ea14de7@aklaver.com> Date: Fri, 15 Oct 2021 06:59:01 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: "two time periods with only an endpoint in common do not overlap" ??? Content-Language: en-US To: Ron , pgsql-general@lists.postgresql.org References: <820B633E-90C6-40F0-81A0-CAA074E5762F@yugabyte.com> <2ff5f521-34ab-8690-180a-864441e4f15b@aklaver.com> <0782c52d-2a80-b37f-0b9e-1a2a7cfb68c5@gmail.com> From: Adrian Klaver In-Reply-To: <0782c52d-2a80-b37f-0b9e-1a2a7cfb68c5@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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