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 1mbRl3-0007g8-Cq for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 18:16:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbRl0-0002CZ-Af for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 18:16:38 +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 1mbRkz-0002CP-TM for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 18:16:37 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mbRkx-0000By-4w for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 18:16:36 +0000 Received: by mail-ot1-x335.google.com with SMTP id l10-20020a056830154a00b00552b74d629aso8900054otp.5 for ; Fri, 15 Oct 2021 11:16:34 -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=1qpmkuBU9p9jNrQ0oywuaGIn0PBzQaqXjr+kb8hStCo=; b=eBS67cpcBlOtO0yCxSsZ9xGgXnnJS2YOuvkzl1DK1xb8BKxnNiKjxlUR6khMGrnj7z W0yBQ18VvzdvXiuVVUn/8vcTpFYJ83sMja/n2bfAqLSIZE7yQGdnbVW45C6ViEFDa+ey BltOJAWAC9atDyZK2LoqxE/Zsiq4jUTVCGxwUm9vkrWBdyq0V+U2xn8uS+ie8sSCVmre SoYAHv+dq5FyiAfS2hAXBt5xWyQqIP7G8Eq2q1mVlLwV3Yuu3rYGBGkOeofaKWa0DGei q3TvRRjGSI+TLt95dx3v4sRoVJqKfSBm0T97Sqqy3fLvozGUaKA3qLqFD2LdLbDe7e4E TK/A== 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=1qpmkuBU9p9jNrQ0oywuaGIn0PBzQaqXjr+kb8hStCo=; b=dP02FrAV+QVP6ESUUlIN2DMUN24gk5TNwn+4EmIoi30QGD1tJ0bR53k9UJNS2hrhJz TTdJ5pYqZUMm0cDjIG4p+346Q5mM2bFBT93BexDgR7cNrWFnuhBUhEUBV7NpB9pb0HN7 xcIMJTdU3rwRw3hoZJ99XXr6XtUNoz1FSpAw8cY9nk27BnOQPXCKRe+ckhwhbdyUs5mN krs23+yulldrSD+pCtJ5vuXT7uZ5Wo8e52WUeHTCSR9SnBUghkitq/cegluXt+TWnjf/ pqtfW40/6uJ0bTkV61dmqUeOB3oAI7fpUHpDb3g3E9LTnJXhV2Njz/MqlpSORAO6pIOK ioNw== X-Gm-Message-State: AOAM532ByGhDS2B445UjT8sbHxtFPg7KcZn8li6mEcr0G5Kqj2HenK9W gpUmRmvQJ5Mr+l78d9RRv0fqKb35Mxs= X-Google-Smtp-Source: ABdhPJzKO898EIn/0SQwmLwEbu0D5JiIv7WBFOVY8u2bR+905usUEqdB2aBNHIy2iYY0qppM/rLdgw== X-Received: by 2002:a9d:655a:: with SMTP id q26mr9246834otl.130.1634321794150; Fri, 15 Oct 2021 11:16:34 -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 v17sm1332812otk.56.2021.10.15.11.16.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 11:16:33 -0700 (PDT) Subject: Re: "two time periods with only an endpoint in common do not overlap" ??? To: 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> <98ea7ea3-38ac-d145-e668-803e5ea14de7@aklaver.com> From: Ron Message-ID: Date: Fri, 15 Oct 2021 13:16:32 -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: <98ea7ea3-38ac-d145-e668-803e5ea14de7@aklaver.com> 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 8:59 AM, Adrian Klaver wrote: > 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. I was afraid you were going to say that.  It's completely bizarre, but seems to be a "thing" in computer science. -- Angular momentum makes the world go 'round.