Re: [GENERAL] missing something obvious about intervals?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] missing something obvious about intervals?
Дата
Msg-id 2116.1134446878@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] missing something obvious about intervals?  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> 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,

The only case I've noticed seeing on a regular basis is Unix timestamp
conversion (ie, the special case where the date is 1970-01-01); and we
did add a built-in function for that in 8.1.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 7.3 failure on platypus
Следующее
От: Christopher Browne
Дата:
Сообщение: Re: Cost-based optimizers