| From: | John Naylor <john(dot)naylor(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix loss of precision in pg_stat_us_to_ms() |
| Date: | 2026-07-02 06:36:39 |
| Message-ID: | E1wfB2N-00138j-2f@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(dot)pg(at)gmail(dot)com>
Discussion: https://postgr.es/m/akIYkMK4bHe9qX/N(at)bdtpg
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3eca140531f1c8e58e9a59af827488616699a052
Modified Files
--------------
src/backend/utils/adt/pgstatfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2026-07-02 06:53:23 | pgsql: test_custom_stats: Fail if loading module outside shared_preload |
| Previous Message | John Naylor | 2026-07-02 06:22:21 | pgsql: Remove stale comment |