Re: [GENERAL] missing something obvious about intervals?

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: [GENERAL] missing something obvious about intervals?
Дата
Msg-id 20051213033945.GS54639@pervasive.com
обсуждение исходный текст
Ответы Re: [GENERAL] missing something obvious about intervals?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Dec 12, 2005 at 12:34:45PM -0600, Bruno Wolff III wrote:
> You are better off doing a multiply. Something like:
> area=> select '2005-12-01'::date + 456.5 * '1 second'::interval;
>         ?column?
> ------------------------
>  2005-12-01 00:07:36.50
> (1 row)

This comes up often enough that it's probably worth adding a built-in
function, especially if it's faster to do the multiply (though
presumably a built-in function could outperform both the multiply and
the more common (4.5::float || ' seconds')::interval form.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


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

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: 7.3 failure on platypus
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 7.3 failure on platypus