Andrus wrote:
>> CREATE OR REPLACE FUNCTION f_v_same_day_overlaps(date,
>> date, date, date, out overlaps bool) as
>> $_$
>> SELECT (($3 between $1 and $2) or ($4 between $1 and $2));
>> $_$ language sql;
>
> Thank you.
> In my application second and fourth parameters can be NULL which means
> forever.
No it doesn't. NULL means "unknown". You're just using it to represent
"forever".
There is a value "infinity" for timestamps, but unfortunately not for
dates. Otherwise, I'd suggest that you use that instead.
--
Richard Huxton
Archonet Ltd