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 1mbazy-0008CL-Kp for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 04:08:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbazx-0006QJ-JY for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 04:08:41 +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 1mbazw-0006QA-GQ for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 04:08:41 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbazr-00018f-D4 for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 04:08:40 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 908E73201A90; Sat, 16 Oct 2021 00:08:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 16 Oct 2021 00:08:32 -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=j krRg4dONO3rXJAtt8CzIVSJJ5dezdrJPOO4ZTsJpxc=; b=vBI9uSyajJuCkkJDS xngwE90BDLBclC4+3pDiyek4qNCdZzLdLayJuOnIgAByxgZFY701mW7vCOgfJQm0 0txc/hme78bt9cKF/xewEx4ilx8mEBnhnwyZKcyD5AkYP7Hx9rCQPaMMWtIhKcad i5FnUi3MKAVRf6jEywMHQ/zyyTfLsaBkYtBLZ2lsdelvWTFuA4n7RoEYCjVD/ZFz rerrbXbTWzb1uKYTeaJsZwRGfmMAU9pLA8t5mQkc16UtQCcCwlWPl8tl8W5ojSp4 Yq7FKfAcDWFoUOE3S5GgqxV0Xs2qJ0+8iL+q3NIfpy4UwcnWYIrSMXCVWFqNYTZn Cpbtg== 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=jkrRg4dONO3rXJAtt8CzIVSJJ5dezdrJPOO4ZTsJp xc=; b=C4u0qZv6CG9g4ilbpbbOcTt+RzYKd9k80DvIrskzK+Kg1A2d/eq94sm/h jUvB34yuaVnhLZfA2IKfCv24obVGvIWoMtNXf8Mr0sQa2bRHVRaWFOkLo/tBbHjx MP9BHZHpiyr+lkJQfFydHU0BDBbYDNzDIpH79AB1uHmmbkJlJVGKqGjCvxxT/Hef K5cd4HbxdSh8hiYLhdX8loJExd1skeQFqfV/UuosNZH5LEJ11GdA8Hv30uF4SUbE AZZiqZYPhbeXOUg7w2lAifYAKBE+vM853UJlq7jyC4aKv2zG1TT3dpiO+j0QbVeS qej9HhnDGHsYOLXgP/XtZrz3fZV3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdduhedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevvdekiefhudfhhfdtkeelgeffudeigfetjeegfffg hfetfeelledugfelleegveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Oct 2021 00:08:31 -0400 (EDT) Message-ID: Date: Fri, 15 Oct 2021 21:08:30 -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-generallists.postgresql.org" References: <820B633E-90C6-40F0-81A0-CAA074E5762F@yugabyte.com> <2ff5f521-34ab-8690-180a-864441e4f15b@aklaver.com> <0782c52d-2a80-b37f-0b9e-1a2a7cfb68c5@gmail.com> <98ea7ea3-38ac-d145-e668-803e5ea14de7@aklaver.com> <6f61f1d3-c110-e6dd-d742-1bb45fb6e90e@gmail.com> From: Adrian Klaver In-Reply-To: <6f61f1d3-c110-e6dd-d742-1bb45fb6e90e@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/15/21 19:42, Ron wrote: > > The numeric ranges 0-10 and 10-19 overlap, just as the time ranges > 00:01:00-00:00:02:00 overlaps 00:02:00-00:03:00. > > *It's the programmer's responsibility* to say what s/he really means, > not for "the system" to make that choice. > It is the programmers choice: --The canonical form. --No overlap select int4range(1,3), int4range(3, 5); int4range | int4range -----------+----------- [1,3) | [3,5) select int4range(1,3) && int4range(3, 5); ?column? ---------- f --Making it overlap select int4range(1,3, '[]'), int4range(3, 5, '[]'); int4range | int4range -----------+----------- [1,4) | [3,6) select int4range(1,3, '[]') && int4range(3, 5, '[]'); ?column? ---------- t There is no straight time range, you would have to use tsrange or tstzrange. The principle still holds though you can make ranges overlap or not depending on '[)' or '[]'. -- Adrian Klaver adrian.klaver@aklaver.com