Search Postgresql Archives

Re: How to specify infinity for intervals ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux