Re: BUG #16747: Unexpected behaviour of the overlaps function

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: ddiamondbbackk(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16747: Unexpected behaviour of the overlaps function
Date: 2020-11-26 16:04:53
Message-ID: CAKFQuwajaxxpf3j0eGO5vsMgBQUrs_SsJrGWhqqRUV3TuL0bCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Nov 26, 2020 at 8:56 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 16747
> Logged by: Paul Luchyn
> Email address: ddiamondbbackk(at)gmail(dot)com
> PostgreSQL version: 11.8
> Operating system: Windows
> Description:
>
> Hello!
>
> I'm working with the "overlaps" function.
> In my humble opinion it works incorrectly in one case.
>

Your examples perfectly match the documentation:

"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. This means for instance that two time periods
with only an endpoint in common do not overlap."

https://www.postgresql.org/docs/13/functions-datetime.html

> And one more question: is there any other function which will do the trick
> in the situation described in the last example?
>

Create an explicit range out of the timestamps and use one of the range
operators/functions?

https://www.postgresql.org/docs/current/functions-range.html

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Павел Лучин 2020-11-26 16:21:06 Re: BUG #16747: Unexpected behaviour of the overlaps function
Previous Message Tom Lane 2020-11-26 15:54:59 Re: BUG #16736: SCRAM authentication is not supported by this driver