Re: 8.3 vs HEAD difference in Interval output?

Поиск
Список
Период
Сортировка
От Kenneth Marshall
Тема Re: 8.3 vs HEAD difference in Interval output?
Дата
Msg-id 20081009200258.GO547@it.is.rice.edu
обсуждение исходный текст
Ответ на Re: 8.3 vs HEAD difference in Interval output?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
On Thu, Oct 09, 2008 at 02:47:24PM -0500, Kevin Grittner wrote:
> >>> Kenneth Marshall <ktm@rice.edu> wrote:
>  
> >>>  Even more surprising is the behavior for interval(1) here:
> >>> [.... some context with nonsurprising examples removed ...]
> >>> ccdev=# select '1 year 2 mons 3 days 04:05:06.64321'::interval(1);
> >>>              interval
> >>> ----------------------------------
> >>>  1 year 2 mons 3 days 04:05:06.60
> >>> (1 row)
> >>> That trailing zero should be considered a bug.
>  
> > What is not clear to me is how the
> > decision to stop at the 2nd decimal digit was reached.
>  
> See this posting and others on the thread:
>  
> http://archives.postgresql.org/pgsql-hackers/2008-09/msg00999.php
>  
> The current rules seem to be:
>  
> (1)  If precision is specified, round to that precision.
>  
> (2)  If result has only zeros in the fraction, show no fraction, else
> show at least two digits in the fraction, adding a trailing zero if
> needed to get to two digits, but don't show any trailing zeros in the
> fraction beyond the second position.
>  
> I think it would be ideal if we could track how many digits of
> accuracy we have in a value, and show them all, even if that involves
> trailing zeros.  If that's not feasible, let's consistently not show
> trailing zeros.  Rounding .64 to .6 and then showing .60 is just plain
> wrong.
>  
> -Kevin
> 
+1

Ken


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [WIP] plpgsql is not translate-aware
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [WIP] plpgsql is not translate-aware