This has come up a few times over the last few months, and I'm not
too keen on the solutions we've been using.
There seems to be a lack of useful functions for converting intervals
to useful representations. For example, I want to display an interval
in hours and fractions of hours only, not hours and minutes. There
are lots of examples of when certain representations are more appropriate
than others (think pregnancy terms, why on earth is the woman never
pregnant for 3 months? It's always 12 weeks!)
Anyway, rant aside, I can't seem to find anything to do this in PG.
I could write a stored procedure easily enough, but I want to make
sure I'm not reinventing the wheel first (I find it hard to believe
I'm the first person ever wanting to do this!)
$ SELECT CONVERT('12 days 13 hours'::INTERVAL AS hour);
$ SELECT CONVERT('6 hours 17 minutes'::INTERVAL AS hour);
Am I approaching this problem wrong? or is there something out there
and my Google skills are lacking?
Collaborative Fusion Inc.
pgsql-general by date
|Next:||From: Magnus Hagander||Date: 2008-02-27 14:50:07|
|Subject: Re: PostgreSQL-installation-problem on Windows XP Home edition|
|Previous:||From: Richard Huxton||Date: 2008-02-27 14:41:09|
|Subject: Re: PostgreSQL-installation-problem on Windows XP Home