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

2008-02-28 Thread Erik Jones
On Feb 28, 2008, at 6:04 AM, Alban Hertroys wrote: 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 pro

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

2008-02-28 Thread Alban Hertroys
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 Goo

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

2008-02-27 Thread Alvaro Herrera
Bill Moran wrote: > It just seemed like this would be something so common that there'd > be something in existence already. I guess I was wrong. Yeah, I have wished for the same thing myself. -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company

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

2008-02-27 Thread Bill Moran
In response to Tom Lane <[EMAIL PROTECTED]>: > Bill Moran <[EMAIL PROTECTED]> writes: > > 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

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

2008-02-27 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > 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. Perhaps EXTRACT(EPOCH ...) to get total seconds and

[GENERAL] Regarding interval conversion functions and a seeming lack of usefulness

2008-02-27 Thread Bill Moran
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 hou