Re: Interval Format

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interval Format
Дата
Msg-id 21350.1227320141@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Interval Format  (Zagato <zagato.gekko@gmail.com>)
Ответы Re: Interval Format  (Zagato <zagato.gekko@gmail.com>)
Список pgsql-sql
Zagato <zagato.gekko@gmail.com> writes:
> I have som SQL that in 8.0.3 do:
> # SELECT '32 hours'::INTERVAL;
>     interval
> -----------------
>  @ 1 day 8 hours
> (1 row)

> And in 8.3.5 do:
> seg_veh2=# SELECT '@ 32 hours'::INTERVAL;
>   interval
> ------------
>  @ 32 hours
> (1 row)

> Why i unable to get my old style of interval,

Because '1 day' isn't really the same thing as '24 hours', at least not
if you live anywhere that they have daylight savings time.

You can probably get the behavior you want by passing the value through
justify_hours(), which does the conversion assuming 1 day == 24 hours.
        regards, tom lane


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

Предыдущее
От: Milan Oparnica
Дата:
Сообщение: JOIN results of refcursor functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: JOIN results of refcursor functions