| From: | Alban Hertroys <alban(at)magproductions(dot)nl> | 
|---|---|
| To: | Andrus <eetasoft(at)online(dot)ee> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Why overlaps is not working | 
| Date: | 2006-11-09 13:59:33 | 
| Message-ID: | 45533445.5040705@magproductions.nl | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Andrus wrote:
> set datestyle to iso,iso;
> 
> select 1 where ('2006-10-31'::date, '9999-12-31'::date) OVERLAPS
>    ('2006-10-16'::DATE, '2006-10-31':: DATE)
> 
> 
> does not return any rows.
> 
> Why ?
They're adjacent, they don't overlap. Check the documentation on 
OVERLAPS, I'm sure it's explicit about whether it is inclusive or 
exclusive (the latter apparently).
> How to make overlaps to return correct result?
  select 1 where ('2006-10-30'::date, '9999-12-31'::date) OVERLAPS
     ('2006-10-16'::DATE, '2006-10-31':: DATE);
  ?column?
----------
         1
(1 row)
-- 
Alban Hertroys
alban(at)magproductions(dot)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 //
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrus | 2006-11-09 14:00:08 | Re: Why overlaps is not working | 
| Previous Message | Rick Schumeyer | 2006-11-09 13:54:20 | database dump then restore on another system? |