NikolayS / postgres_dba

The missing set of useful tools for Postgres DBAs and all engineers
BSD 3-Clause "New" or "Revised" License
1.1k stars 113 forks source link

division by zero in report 0 #23

Closed NikolayS closed 5 years ago

NikolayS commented 6 years ago
psql:/home/nikolay/postgres_dba/sql/0_node.sql:74: ERROR:  division by zero
NikolayS commented 6 years ago

At least one reason hides here:

select 'Forced Checkpoints', (select round(100.0 * checkpoints_req::numeric / nullif((checkpoints_timed + checkpoints_req), 0), 1)::text || '%' from pg_stat_bgwriter)
union all

Ways to resolve:

NikolayS commented 5 years ago

fixed in https://github.com/NikolayS/postgres_dba/pull/31