Re: [BUGS] numerics lose scale and precision in views of unions - Mailing list pgsql-hackers

From mark@mark.mielke.cc
Subject Re: [BUGS] numerics lose scale and precision in views of unions
Date
Msg-id 20060810141738.GA15704@mark.mielke.cc
Whole thread Raw
In response to Re: [BUGS] numerics lose scale and precision in views of unions  (mark@mark.mielke.cc)
List pgsql-hackers
On Thu, Aug 10, 2006 at 09:20:09AM -0400, mark@mark.mielke.cc wrote:
> Mathematically, 1.0 = 0.9500... -> 1.05000...
> 
> In theory, B-Tree could be fine with this. As long as the operators
> for =, <>, <, and > are made to consistently understand this principle.
> For example:
> 
>     1.0 = 0.95
>     1.0 = 1.05
>     1.0 <> 0.94
>     1.0 <> 1.06
>     0.94 < 1.0
>     1.06 > 1.0
> 
> I'm not sure that it warrants being changed, though. Storing mixed
> precision values in a column and expecting the database to understand
> rounding rules does not appeal to me. Too magical.

I take this back. It's magical enough to be impossible.

If 1.0 is inserted, and then 1.05, it could consider them 'equal' and
put them together. If 1.1 and 1.14 were inserted, they could be 'equal'
and put together. Then an insertion of '1' would have to re-group them
all together, making the B-Tree ineffective.

So - taking back what I say above.

Cheers,
mark

-- 
mark@mielke.cc / markm@ncf.ca / markm@nortel.com     __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada
 One ring to rule them all, one ring to find them, one ring to bring them all                      and in the darkness
bindthem...
 
                          http://mark.mielke.cc/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Casts
Next
From: "Dave Page"
Date:
Subject: Re: 8.2 features status