Note the third row in the query result below is in error. The four hour
interval
(2300UTC - 0300UTC) does not overlap the interval 1530UTC-1627UTC). Is this
a bug? It would be cool if timetz (or time) datatypes were to wrap properly
across day boundaries (i.e. if start time < stop time then assume start time
is day before) but at the very least, the overlaps functions should not lie
to you!
Jeff Patterson
swl=# select freq,start,stop from sched where freq = '7200' and
swl-# overlaps(timetz '15:30UTC',timetz '16:27UTC',start,stop);
freq | start | stop
------+-------------+-------------
7200 | 15:30:00+00 | 16:27:00+00
7200 | 15:00:00+00 | 17:00:00+00
7200 | 23:00:00+00 | 03:00:00+00
7200 | 21:00:00+00 | 16:00:00+00
7200 | 16:00:00+00 | 19:00:00+00
7200 | 15:00:00+00 | 16:00:00+00
7200 | 20:00:00+00 | 16:00:00+00
7200 | 02:00:00+00 | 16:30:00+00