Re: Why overlaps is not working

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Why overlaps is not working
Дата
Msg-id 4555F061.4030307@archonet.com
обсуждение исходный текст
Ответ на Re: Why overlaps is not working  ("Andrus" <eetasoft@online.ee>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Jorge Godoy
Дата:
Сообщение: Re: Why overlaps is not working
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Why overlaps is not working