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

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal: rounding up time value less than its unit.
Date: 2014-08-23 20:01:22
Message-ID: 1408824082619-5816007.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane-2 wrote
> Tomonari Katsumata &lt;

> t.katsumata1122@

> &gt; 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-08-23 20:38:57 Re: proposal: rounding up time value less than its unit.
Previous Message Tom Lane 2014-08-23 18:22:50 Re: proposal: rounding up time value less than its unit.