Re: Converting interval to numeric?

From: "Rodolfo J(dot) Paiz" <rpaiz(at)simpaticus(dot)com>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Sal Dkj <saldkj(at)hotmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Converting interval to numeric?
Date: 2005-02-14 18:45:01
Message-ID: 1108406702.5209.26.camel@rodolfo.gt.factorrent.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2005-02-10 at 22:58 -0600, Bruno Wolff III wrote:
> EXTRACT the EPOCH from the difference of the timestamps. This will give
> you the elapsed times in seconds (as a float8 I think).
>

This is unnecessarily complicated, don't you think? Doesn't it make
sense that there should be a way to get an interval "cast" to only hours
or only minutes or only days?

Instead of an interval *always* being shown as "3 days 4 hours 5
minutes", why can't we get "76 hours" or "4565 minutes"? Isn't there a
function to extract, or cast, or something? And if not, should there be?

Cheers,

--
Rodolfo J. Paiz <rpaiz(at)simpaticus(dot)com>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Deepblues 2005-02-14 19:11:19 Question on PL/Perl
Previous Message Kjetil Haaland 2005-02-14 09:08:43 Re: function returning a row