On 30 March 2010 11:55, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I think what Mike is actually looking for is
>
> SELECT extract(epoch from interval '3 days 2 hours 34 minutes');
> date_part
> -----------
> 268440
Yet better, if I define 1 hour as 3600 seconds (this is only incorrect
if the interval spans over a leap second), then the fractional hours
are:
SELECT extract(epoch from interval '3 days 2 hours 34 minutes')/3600 as hours;
Thanks!
-Mike