Re: Interval->day proposal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interval->day proposal
Дата
Msg-id 13781.1117636267@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Interval->day proposal  (Michael Glaesemann <grzm@myrealbox.com>)
Список pgsql-hackers
Michael Glaesemann <grzm@myrealbox.com> writes:
> I've started working on this change, and one difference has shown up  
> immediately in the regression tests. v8.0.3 currently returns:

>    SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
>                9 years...
>    ----------------------------------
> !  9 years 1 mon -11 days -10:46:00
>    (1 row)

> With my first round of changes,

>    SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
>                9 years...
>    ----------------------------------
> !  9 years 1 mon -12 days +13:14:00
>    (1 row)

Right, because it is now possible for day and hour to have different signs.
Comes with the territory I think.

> These are equivalent in both CVS and my branch, as '1 day'::interval  
> = '24 hours'::interval. I haven't checked the SQL spec yet (and  
> intend to do so), but is there a canonical form for intervals that we  
> need to return?

AFAICS, the spec only allows one sign for the entire interval value,
so this behavior is already outside the spec.  As long as we don't
generate different field signs in cases where that was not already
present in the input, I don't think it's a spec violation.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Interval->day proposal
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can we simplify win32 threading code