Re: Why overlaps is not working - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Why overlaps is not working
Date
Msg-id 45534967.3060500@magproductions.nl
Whole thread Raw
In response to Re: Why overlaps is not working  ("Andrus" <eetasoft@online.ee>)
List pgsql-general
Andrus wrote:
> I have a number of select statements (in 8.1 and 8.2beta) which assume that
> overlaps returns true for those cases.
>
> Which the best way to fix them ?
>
> Should I use AND, OR and date comparison operators instead of OVERLAPS ?

Why not just subtract/add 1, so that the check includes the boundary dates?

Like so;
  select 1 where ('2006-10-31'::date -1, '9999-12-31'::date +1) OVERLAPS
    ('2006-10-16'::DATE -1, '2006-10-31':: DATE +1)

Regards,
--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: cannot connect anymore from a remote host
Next
From: Alvaro Herrera
Date:
Subject: Re: authentication question