Re: proposal: rounding up time value less than its unit.

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: proposal: rounding up time value less than its unit.
Дата
Msg-id 1408824082619-5816007.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: proposal: rounding up time value less than its unit.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: proposal: rounding up time value less than its unit.
Список pgsql-hackers
Tom Lane-2 wrote
> Tomonari Katsumata <

> t.katsumata1122@

> > writes:
>> This patch rounds up the value when only it's less than required unit.
>> ..
>> Although my original complaint is fixed, I'm worried about this change
>> will
>> make users confusing.
> 
> Indeed.  I have not understood why you are insisting on "round up"
> semantics.  Wouldn't it make more sense for the behavior to be "round to
> nearest"?  That would get rid of any worries about treating zero
> specially.

Wasn't the goal that all non-zero values result in the feature being
enabled?  With round nearest there will still be some values that are
non-zero but that round to zero and thus disable the feature.

Values failing in the range (0, 1) in the canonical unit must be treated
specially otherwise we might as well just leave the current behavior as-is
since floor is likely just as good a rule as round-nearest.

For fractions greater than one round nearest is probably fine and indeed on
average results in the least amount of potential adjustment magnitude.

David J.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/proposal-rounding-up-time-value-less-than-its-unit-tp5811102p5816007.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: proposal: rounding up time value less than its unit.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: proposal: rounding up time value less than its unit.