I thought the suggested solution was to use infinity, hence the
requirement to cast to timestamps.
That'd mean something along the lines of:
where (a::timestamp, coalesce(b, 'infinity')::timestamp) overlaps
(c::timestamp, coalesce(d, 'infinity')::timestamp)
select (date'20060101'::timestamp, coalesce(date'20060102'::timestamp,
'infinity')) overlaps
(date'20060102', coalesce(date'20060103'::timestamp, 'infinity'))
returns false but since date'20060102' is overlapping it must return true.
So it seems that it is not possible to use timestamps and infinity.
Andrus.
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match