pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ddiamondbbackk@gmail.com
Subject: BUG #16747: Unexpected behaviour of the overlaps function
Date: Thu, 26 Nov 2020 15:24:27 +0000
Message-ID: <16747-cafc5e9e88e8c5b3@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16747
Logged by:          Paul Luchyn
Email address:      ddiamondbbackk@gmail.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.
I have prepared some examples.

1) Two intervals with zero duration: SELECT (TIMESTAMP '2020-11-29
12:00:00.000', TIMESTAMP '2020-11-29 12:00:00.000') OVERLAPS (TIMESTAMP
'2020-11-29 12:00:00.000', TIMESTAMP '2020-11-29 12:00:00.000'); ,the result
is "true", looks fine.
2) Interval with zero duration, and non-zero interval: SELECT (TIMESTAMP
'2020-11-29 12:00:00.000', TIMESTAMP '2020-11-29 12:00:00.000') OVERLAPS
(TIMESTAMP '2020-11-29 12:00:00.000', TIMESTAMP '2020-11-29 12:02:00.000');
,the result is "true", looks fine.
3) Two intervals with non-zero duration: SELECT (TIMESTAMP '2020-11-29
12:00:00.000', TIMESTAMP '2020-11-29 12:01:00.000') OVERLAPS (TIMESTAMP
'2020-11-29 12:01:00.000', TIMESTAMP '2020-11-29 12:02:00.000'); , the
result is false. The last case looks suspicious: logically these two
intervals don't overlap, but they have common moment of time (2020-11-29
12:01:00.000).

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



view thread (4+ messages)  latest in thread

Message-ID: <16747-cafc5e9e88e8c5b3@postgresql.org>
Permalink:  ../16747-cafc5e9e88e8c5b3@postgresql.org/
Also on:    postgresql.org/message-id/16747-cafc5e9e88e8c5b3@postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ddiamondbbackk@gmail.com
  Subject: Re: BUG #16747: Unexpected behaviour of the overlaps function
  In-Reply-To: <16747-cafc5e9e88e8c5b3@postgresql.org>

* 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