Re: Integer input functions for date and timestamp

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Integer input functions for date and timestamp
Дата
Msg-id 29164.1287781842@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Integer input functions for date and timestamp  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Ooh, I like it.  A related personal pet peeve of mine: AFAIK the
> easiest way to convert from an integer number of seconds to an
> interval representing that many seconds is:

> (the_int || ' s')::interval

No, the standard solution is
the_int * '1 second'::interval

which is fast and adapts readily to different units for the interval
number.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Extensions, this time with a patch
Следующее
От: Greg Smith
Дата:
Сообщение: Re: ask for review of MERGE