Re: formating interval question - Mailing list pgsql-general

From Tom Lane
Subject Re: formating interval question
Date
Msg-id 21534.1096036651@sss.pgh.pa.us
Whole thread Raw
In response to formating interval question  (mike <mike@bristolreccc.co.uk>)
List pgsql-general
mike <mike@bristolreccc.co.uk> writes:
> I have an interval field which is used to calculate total hours.
> At present it outputs as days hours minutes
> Is there any way to output as total hours

You could always EXTRACT(EPOCH ...) to get total seconds and then
divide.  I am not sure whether EXTRACT(HOUR ...) would give the
same answer, or just the hours portion of the normal printout.
But anyway, see EXTRACT.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Large arrays give long lag on server side before command executes
Next
From: Amin Abdulghani
Date:
Subject: Removed and then missing pg_clog file