Re: fomatting an interval (resend)

Поиск
Список
Период
Сортировка
От greg@turnstep.com
Тема Re: fomatting an interval (resend)
Дата
Msg-id e2c43091345100d4a0ed245f5ddbfa2a@biglumber.com
обсуждение исходный текст
Ответ на Re: fomatting an interval (resend)  (Joseph Shraibman <jks@selectacast.net>)
Ответы Re: fomatting an interval (resend)  ("Forest Wilkinson" <lyris-pg@tibit.com>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>> write a pl/pgsql function that outputs the format, based on receiving
>> the interval in seconds.
>
> I don't want to do something so complicated.  There is already a to_char()
> method, I just want to know what I should pass into it.

What sort of output are you exactly looking for? Intervals by nature output
a mixed format, so I don't think there is anything simple you can do with
to_char to get what you want. Can you give some examples of your desired
output for different intervals?


Here is one consistent conversion that will show you the number of seconds
without anything else:


select round(extract(epoch from finish) - extract(epoch from start)) from timetable;


- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200305141036

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+wlWQvJuQZxSWSsgRApHtAJ4ppW3EgVQpoveF6z+yEKPW0BziKACg75bO
eZfRxYjgHopdTeO4B7vv/j0=
=sID9
-----END PGP SIGNATURE-----




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

Предыдущее
От: "Rob Larter"
Дата:
Сообщение: query help
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Serialization, Locking...implement processing Queue with a table