Fix loss of precision in pg_stat_us_to_ms()
John Naylor <john.naylor@postgresql.org>
Fix loss of precision in pg_stat_us_to_ms() Multiplying by the constant 0.001 can produce trailing-digit noise in displayed values (for example 0.009000000000000001 instead of 0.009, with default extra_float_digits) because 0.001 cannot be represented exactly in binary floating point. Use division by 1000.0 instead, matching code elsewhere in the tree. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/akIYkMK4bHe9qX/N@bdtpg
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/pgstatfuncs.c | modified | +1 −1 |
Discussion
- Fix floating-point noise in pg_stat_us_to_ms() 3 messages · 2026-06-29 → 2026-07-02