Re: proposal: rounding up time value less than its unit. - Mailing list pgsql-hackers

From David G Johnston
Subject Re: proposal: rounding up time value less than its unit.
Date
Msg-id 1408824082619-5816007.post@n5.nabble.com
Whole thread Raw
In response to Re: proposal: rounding up time value less than its unit.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: rounding up time value less than its unit.
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: rounding up time value less than its unit.
Next
From: Tom Lane
Date:
Subject: Re: proposal: rounding up time value less than its unit.