Re: How to specify infinity for intervals ?

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: How to specify infinity for intervals ?
Дата
Msg-id 20060222202733.GF86022@pervasive.com
обсуждение исходный текст
Ответ на How to specify infinity for intervals ?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: How to specify infinity for intervals ?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
On Mon, Feb 20, 2006 at 07:24:05PM +0100, Karsten Hilbert wrote:
> I am storing the maximum age a vaccination is due in a
> patient (eg. "don't give this vaccination beyond the age of
> 10 years" or some such). Some vaccinations are to be given
> regardless of age.
>
> Up to now I have used NULL to mean "no maximum age". That
> doesn't really feel right and also complicates the SQL
> needed for retrieving data.
>
> I *could*, of course, use something like '999 years' as a
> special value to indicate "no upper limit" figuring that no
> one is going to live that long in the foreseeable future.
>
> However, the technically elegant and satisfying solution
> would be to be able to use "infinite" with interval data
> types much like "infinity" with timestamps. I have tried
> various syntax attempts, calculations and casts but haven't
> found any returning an interval of infinite length. The docs
> and Google don't help, either.

I suspect that you could create either a domain or a custom type that
would handle this they way you wanted.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

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

Предыдущее
От: "Guy Rouillier"
Дата:
Сообщение: Re: is there webadmin sw written in jsp/servlet
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Performance Problems