Re: How to specify infinity for intervals ?

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: How to specify infinity for intervals ?
Дата
Msg-id 2B036DC9-EA32-4E6F-948B-5B88DD3228CA@myrealbox.com
обсуждение исходный текст
Ответ на Re: How to specify infinity for intervals ?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
On Feb 22, 2006, at 1:51 , Karsten Hilbert wrote:

> I specifically wanted to avoid that by
> something like 'infinite'::interval in some way or other
> such that I could always do
>
>     "... where now < date_of_birth + max_age ..."
>
> and not need an
>
>     "... or max_age is null ..."
>
> in all the places.

I'd wrap it in an SQL function (untested):

create function ok_to_vaccinate(date, interval)
returns boolean
language sql as'
select current_timestamp < $1 + $2 or $2 is null
';

Michael Glaesemann
grzm myrealbox com




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

Предыдущее
От: "Sanjay Arora"
Дата:
Сообщение: Attn. PostgreSQL.org webmasters: Site Link not working
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: How to specify infinity for intervals ?