"George Pavlov" <[EMAIL PROTECTED]> writes: > The datatype of both city.latitude and postal_code.latitude is > number(16,12). > This works, but I would like to understand why there is sometimes a > discrepancy between avg(pc.latitude) and what actually gets inserted > into the city table -- is it the usual floating-point discrepancy or is > there something I can do about it? E.g. after the above update:
You're forcing the result of the avg() calculation to be rounded to 12 digits when you store it into city.latitude. Your example simply shows that the avg() calculation is being done to more precision than that. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match