Re: [GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Mike Toews
On 30 March 2010 11:55, Tom Lane 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 le

Re: [GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Tom Lane
Alban Hertroys writes: > On 30 Mar 2010, at 18:29, Mike Toews wrote: >> I'm using 8.3, and I'm trying to work with the interval type, and I >> can't seem to get things right. I've been all over the docs[1,2], and >> there is no mention on how this can be done. >> >> While I can get: >> SELECT '3

Re: [GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Alban Hertroys
On 30 Mar 2010, at 18:29, Mike Toews wrote: > I'm using 8.3, and I'm trying to work with the interval type, and I > can't seem to get things right. I've been all over the docs[1,2], and > there is no mention on how this can be done. > > While I can get: > SELECT '3 day 2 hour 34 minute'::interval

[GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Mike Toews
I'm using 8.3, and I'm trying to work with the interval type, and I can't seem to get things right. I've been all over the docs[1,2], and there is no mention on how this can be done. While I can get: SELECT '3 day 2 hour 34 minute'::interval .. how can then get the fractional hours of this time i