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 1mbbiL-0001qJ-CA for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 04:54:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbbiK-0005IP-9P for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 04:54:32 +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 1mbbiJ-0005IG-W0 for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 04:54:31 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mbbiI-000284-5K for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 04:54:31 +0000 Received: by mail-oi1-x22b.google.com with SMTP id v77so11783647oie.1 for ; Fri, 15 Oct 2021 21:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=+FrgPTxKE9cyxB/H1rWS1/k1/cdvUc62KxBIPgrOlbs=; b=GKbO8eUe+KcglelwDMBG/Pe9MLpgayywhyCtVzQbbdolmPVQRu8DhcVB+KkfDt1x/c egr89+eDJIMW9gAQG3O4v1JOYhYAPz2qkiRLPNUmFUzQFGtn5UWsUTdV/c5rlYaWfyAe uPCa4HvCqPkSLP5ampY56YDk9byw2ARYJAa/dCPvSSR/3+qCig0hl2aW2jTGvCyz2TkD zBCDNWxZwxtiiMtFE8G6In94mNqinDcII0GVqrAS0v+LubJDuXcVmEMiW0U1cIV7ZAxV ciSRY/fhlzciKGCKdv1WHHgVdw7zg9poFB24v9dqxb7KNowhpwALhBT3Eqg8IGS863ga D77Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=+FrgPTxKE9cyxB/H1rWS1/k1/cdvUc62KxBIPgrOlbs=; b=qPjDLZzPuKd2Dv2FTKM9O4YP9zTec0iDA1LqaEcB2qsrrLa/3Hn7/tKLiNGIe69QFC ESJaiXWzWt70vZ2zOa5ZWR0rXWQvyHPjQK8WBaC2+Y9SpQp+BEVkpjcQ1MlDWPk5s+m8 CTSoEgz8cpksHDIx3SqWaNHPJDs6K6q+6TP4ZHA7401VGDw1l0pfbeW799yrLtwlxbwW 9ZUuQ955TIOjsSwQim9kQNYVaoZ8aoabZEIG+h2aAfJZGaPH7fzFiR93eFc32x80+qfP SMtIherJPabEchXaq8HwYyoytGUn/5QdcXJU5G5GJaz8MVd8OGkbF0WduP0loKuOxeAS 6eJw== X-Gm-Message-State: AOAM531HWNEgU5y8v0tnm3TmbO9tDKugpCs9crGacUQ96S9PaflkXRmo 9NhM5Z4bZDMXdzyhMx9ck9iGgXO+wxE= X-Google-Smtp-Source: ABdhPJzfiPcnvATNMsjQ3CsPBEqusNEofCC0tZ/MywNw1xeVKFpaIVCGOqEA+Kn2LRkG51RZi9xvJw== X-Received: by 2002:a54:4e94:: with SMTP id c20mr11323394oiy.57.1634360068205; Fri, 15 Oct 2021 21:54:28 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id p12sm1360721oot.29.2021.10.15.21.54.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 21:54:27 -0700 (PDT) Subject: Re: "two time periods with only an endpoint in common do not overlap" ??? To: "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: Ron Message-ID: Date: Fri, 15 Oct 2021 23:54:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/15/21 11:08 PM, Adrian Klaver wrote: > 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 '[]'. OP refers to the OVERLAP operator (is it an operator), not the tsrange() function. -- Angular momentum makes the world go 'round.