Re: [BUGS] BUG #6192: Incorrect result from operator overlaps

2011-09-01 Thread Vik Reykja
On Thu, Sep 1, 2011 at 10:27, Incorrect result from operator wolfm...@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


Re: [BUGS] BUG #6192: Incorrect result from operator overlaps

2011-09-01 Thread Tom Lane
Incorrect result from operator overlaps wolfm...@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

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs