Search Postgresql Archives

A few things on intervals

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

 



I am trying to get infinity in an interval type on PostgreSQL 7.4.7.
I can't seem to get this done, even though there's allegedly an isfinite(interval) function. For now we use NULL instead, but what would have worked?

Next to that I noticed:

 select age('infinity'::timestamp);
                       age
-------------------------------------------------
 -292270 years -8 mons -11 days -04:00:54.775807
(1 row)


Another problem we have is that we want to extract the value and the unit seperately from our intervals, mainly to cast them to something that can be used in PHP and HTML forms. We don't need to calculate on them in PHP, but we'd like to split the number and the type into a text and a drop-down field. I realize that this isn't possible for intervals like '1 year 3 months', but we only use relatively simple intervals like '3 months', '6 weeks' and '100 hours'.

Is there some easy way to query such intervals in a way that can be reliably split up?

Regards,
--
Alban Hertroys
alban@xxxxxxxxxxxxxxxxx

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //


[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