Search Postgresql Archives

Re: Regarding interval conversion functions and a seeming lack of usefulness

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

 



On Feb 27, 2008, at 3:47 PM, Bill Moran wrote:
Something like:
$ SELECT CONVERT('12 days 13 hours'::INTERVAL AS hour);
 hour
------
   301
$ SELECT CONVERT('6 hours 17 minutes'::INTERVAL AS hour);
 hour
------
6.2833

Am I approaching this problem wrong? or is there something out there
and my Google skills are lacking?

One of the obvious problems with this is that you cannot convert months to something more fine-grained without knowing the date the interval is relative to. I mean, what would be the answer of:

$ SELECT CONVERT('2 months'::INTERVAL AS days);

This month that would be 60 days, next month 61, this month next year 59, etc. And I haven't even started on leap seconds and daylight saving time yet...

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,47c69dd2233091191611641!



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[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