MySQL-esque sec_to_time() function

Поиск
Список
Период
Сортировка
От George Johnson
Тема MySQL-esque sec_to_time() function
Дата
Msg-id 002c01c05fa1$7d8deb00$0300a8c0@jdsc
обсуждение исходный текст
Ответы RE: MySQL-esque sec_to_time() function  ("Francis Solomon" <francis@stellison.co.uk>)
Re: MySQL-esque sec_to_time() function  (Zachary Beane <xach@xach.com>)
Список pgsql-general
Hello,
 
I'm converting from MySQL to PostgreSQL (actually flipping/flopping back) and have a question:
 
 
MySQL has a cool function sec_to_time() which converts your number of seconds to hh:mm:ss
 
I've read thru the mailing lists and am basically trying to implement the following:
 
 
MySQL:
select sec_to_time(sum(unix_timestamp(enddate) - unix_timestamp(startdate))) from foo;
 
PostgreSQL:
select XXX(sum(date_part('epoch',enddate) - date_part('epoch',startdate))) from foo;
 
I just need to know what XXX is/can be.  I've tried a lot of combinations of the documented functions and come up with useless conversions.
 
Thanks,
George Johnson
 
PS:  i can't find documentation on how to load the functions in contrib.  I can compile and
       install them O.K., but not sure how to make them load.

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

Предыдущее
От: Jeff Meeks
Дата:
Сообщение: Design and development info
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: Many postmasters...