Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux