pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6192: Incorrect result from operator "overlaps"
3+ messages / 3 participants
[nested] [flat]

* BUG #6192: Incorrect result from operator "overlaps"
@ 2011-09-01 08:27 Incorrect result from operator  overlaps  <wolfmoon@o2.pl>
  2011-09-01 15:31 ` Re: BUG #6192: Incorrect result from operator "overlaps" Vik Reykja <vikreykja@gmail.com>
  2011-09-01 15:39 ` Re: BUG #6192: Incorrect result from operator "overlaps" Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: Incorrect result from operator "overlaps" @ 2011-09-01 08:27 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      6192
Logged by:          Incorrect result from operator "overlaps"
Email address:      wolfmoon@o2.pl
PostgreSQL version: 9.0.4
Operating system:   Debian/Sid
Description:        Incorrect result from operator "overlaps"
Details: 

SELECT ('2011-08-31'::date,'2011-08-31'::date) overlaps
('2011-08-1'::date,'2011-08-31'::date);
Returns false, should return true.

SELECT ('2011-08-31'::date,'2011-08-31'::date) overlaps
('2011-08-1'::date,'2011-09-1'::date);
Returns true, as it should.

SELECT ('2011-08-31'::date,'2011-08-31'::date) overlaps
('2011-08-31'::date,'2011-09-1'::date);
Returns true, as it should.

Tested in versions 8.3.14, 8.4.7 and 9.0.4.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #6192: Incorrect result from operator "overlaps"
  2011-09-01 08:27 BUG #6192: Incorrect result from operator "overlaps" Incorrect result from operator  overlaps  <wolfmoon@o2.pl>
@ 2011-09-01 15:31 ` Vik Reykja <vikreykja@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Vik Reykja @ 2011-09-01 15:31 UTC (permalink / raw)
  To: Incorrect result from operator <wolfmoon@o2.pl>; +Cc: pgsql-bugs

On Thu, Sep 1, 2011 at 10:27, Incorrect result from operator <wolfmoon@o2.pl
> wrote:

>
> SELECT ('2011-08-31'::date,'2011-08-31'::date) overlaps
> ('2011-08-1'::date,'2011-08-31'::date);
> Returns false, should return true.
>

According to the documentation, it should return false.

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

http://www.postgresql.org/docs/current/static/functions-datetime.html

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #6192: Incorrect result from operator "overlaps"
  2011-09-01 08:27 BUG #6192: Incorrect result from operator "overlaps" Incorrect result from operator  overlaps  <wolfmoon@o2.pl>
@ 2011-09-01 15:39 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2011-09-01 15:39 UTC (permalink / raw)
  To: Incorrect result from operator " overlaps " <wolfmoon@o2.pl>; +Cc: pgsql-bugs

"Incorrect result from operator "overlaps"" <wolfmoon@o2.pl> writes:
> SELECT ('2011-08-31'::date,'2011-08-31'::date) overlaps
> ('2011-08-1'::date,'2011-08-31'::date);
> Returns false, should return true.

This is correct per SQL standard.  The spec is written such that an
interval is considered half-open, ie ['2011-08-01', '2011-08-31').
So that does not overlap the point '2011-08-31'.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-09-01 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01 08:27 BUG #6192: Incorrect result from operator "overlaps" Incorrect result from operator  overlaps  <wolfmoon@o2.pl>
2011-09-01 15:31 ` Vik Reykja <vikreykja@gmail.com>
2011-09-01 15:39 ` Tom Lane <tgl@sss.pgh.pa.us>

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