Re: "two time periods with only an endpoint in common do not overlap" ??? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: "two time periods with only an endpoint in common do not overlap" ???
Date
Msg-id 4ad064ba-1650-cefd-2c44-db909937f90a@aklaver.com
Whole thread Raw
In response to Re: "two time periods with only an endpoint in common do not overlap" ???  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general
On 10/15/21 21:54, Ron wrote:

>>
>>
>> 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.
> 

Your statement was:

"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."

I was just pointing out that is not necessarily true. As was pointed out 
upstream there are good reasons for not having 1:00-2:00 and 2:00-3:00 
overlap.

As David pointed out it is about following the documented behavior. I 
still have to remember, on occasion, that BETWEEN actually includes the 
end points not just points in between them.

-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Wrong sorting on docker image
Next
From: Thomas Munro
Date:
Subject: Re: Wrong sorting on docker image