pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: "two time periods with only an endpoint in common do not overlap" ???
Date: Fri, 15 Oct 2021 23:54:27 -0500
Message-ID: <bb79ff9e-acee-c73d-3379-bea13db377b9@gmail.com> (raw)
In-Reply-To: <e4c9e650-8361-8f8e-2357-e4919e2ed8d7@aklaver.com>
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>
	<d496d507-8abd-7e11-8e82-0f2983641803@gmail.com>
	<CAJ2+uGWsa0kZH2zvfBADMo=qy9UJC4aMuHLgQyVHMZyGFx==QQ@mail.gmail.com>
	<6f61f1d3-c110-e6dd-d742-1bb45fb6e90e@gmail.com>
	<e4c9e650-8361-8f8e-2357-e4919e2ed8d7@aklaver.com>

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.





view thread (24+ messages)  latest in thread

Message-ID: <bb79ff9e-acee-c73d-3379-bea13db377b9@gmail.com>
Permalink:  ../bb79ff9e-acee-c73d-3379-bea13db377b9@gmail.com/
Also on:    postgresql.org/message-id/bb79ff9e-acee-c73d-3379-bea13db377b9@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: "two time periods with only an endpoint in common do not overlap" ???
  In-Reply-To: <bb79ff9e-acee-c73d-3379-bea13db377b9@gmail.com>
  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> <d496d507-8abd-7e11-8e82-0f2983641803@gmail.com> <CAJ2+uGWsa0kZH2zvfBADMo=qy9UJC4aMuHLgQyVHMZyGFx==QQ@mail.gmail.com> <6f61f1d3-c110-e6dd-d742-1bb45fb6e90e@gmail.com> <e4c9e650-8361-8f8e-2357-e4919e2ed8d7@aklaver.com> <bb79ff9e-acee-c73d-3379-bea13db377b9@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox