More straight forward method to convert seconds::bigint to interval

Поиск
Список
Период
Сортировка
От Shane R. Spencer
Тема More straight forward method to convert seconds::bigint to interval
Дата
Msg-id 4ABA85AB.5060704@bogomip.com
обсуждение исходный текст
Ответы Re: More straight forward method to convert seconds::bigint to interval  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: More straight forward method to convert seconds::bigint to interval  (Adam Rich <adam.r@sbcglobal.net>)
Список pgsql-general
I work in VoIP.  HMS (Hour/Minute/Second) format appears to be the rule
when working with call time totals.  I admit it makes some reports
easier to read.

The method I used to convert a int/bigint to HMS (or the standard
representation of an interval type) is as follows:

select (123456.789::varchar(24) || ' seconds')::interval as HMS;
     hms
--------------
 34:17:36.789

Is there a less string oriented method of converting seconds as an int
to an interval?

- Shane


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: JC Praud
Дата:
Сообщение: grants on pg_stats_activity
Следующее
От: Tom Lane
Дата:
Сообщение: Re: More straight forward method to convert seconds::bigint to interval