pg_walinspect float4/float8 confusion
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-09-08T11:53:10Z
Lists: pgsql-hackers
The pg_walinspect function pg_get_wal_stats() has output arguments declared as float4 (count_percentage, record_size_percentage, etc.), but the internal computations are all done in type double. Is there a reason why this is then converted to float4 for output? It probably doesn't matter in practice, but it seems unnecessarily confusing. Or at least add a comment so it doesn't look like an accident. Also compare with pgstattuple, which uses float8 in its SQL interface for similar data.
Commits
-
pgstattuple: Use double consistently for percentages
- 07d8af5e5e0c 16.0 landed
-
Use float8 datatype for percentiles in pg_walinspect stat functions
- 57796a0f15f8 16.0 landed
- c8a1bc01c6b0 15.0 landed