so, does this overlap or not...? - fencepost question on overlaps() - Mailing list pgsql-general

From Frank van Vugt
Subject so, does this overlap or not...? - fencepost question on overlaps()
Date
Msg-id 201006031400.40835.ftm.van.vugt@foxi.nl
Whole thread Raw
Responses Re: so, does this overlap or not...? - fencepost question on overlaps()
List pgsql-general
Hi,

This doesn't seem to make sense to me, can someone explain the rationale
behind it?


postgres=# select version();
                                        version
---------------------------------------------------------------------------------------
 PostgreSQL 8.4.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
4.3.3, 64-bit
(1 row)



Range 1 ending on date A does not overlap with range 2 starting on date A:

postgres=# select ('2010-01-01'::date, '2010-01-05'::date) overlaps
('2010-01-05'::date, '2010-01-10'::date);
 overlaps
----------
 f
(1 row)



But it does when range 1 is only a single day:

postgres=# select ('2010-01-05'::date, '2010-01-05'::date) overlaps
('2010-01-05'::date, '2010-01-10'::date);
 overlaps
----------
 t
(1 row)


BTW, it doesn't matter whether one casts to date or timestamp




--
Best,




Frank.

pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Attempting to get kerberos authentication working
Next
From: Oleg Bartunov
Date:
Subject: Re: tsearch2 & dictionaries - possible problem