-
Problem report
-
Resolution: Fixed
-
Trivial
-
5.0.0
-
Debian/buster, postgresql-12 12.3-1.pgdg100+1
-
Sprint 66 (Jul 2020), Sprint 67 (Aug 2020)
-
0.25
Steps to reproduce:
- Install the Template according to its README
- Increase zabbix-agent debug level to 4
- In the agent log, look for the error "psql:/var/lib/zabbix/postgresql/pgsql.dbstat.sql:17: ОШИБКА: имя поля не может быть NULL (which means "column name cannot be NULL")
The reason of the error is the new development described in https://rjuju.github.io/postgresql/2019/04/18/new-in-pg12-statistics-checksums-errors.html
As a side effect, pg_stat_database will also now show available statistics for shared objects (such as the pg_database table for instance), in a new row with datid valued to 0, and a NULL datname. Those were always accumulated, but weren’t displayed in any system view until now.
Patch:
A simple patch solves the problem
index d874658ccc..9a6e4c4de8 100644 --- a/templates/db/postgresql/postgresql/pgsql.dbstat.sql +++ b/templates/db/postgresql/postgresql/pgsql.dbstat.sql @@ -14,4 +14,4 @@ SELECT json_object_agg(datname, row_to_json(T)) FROM ( temp_files, temp_bytes, deadlocks - FROM pg_stat_database) T + FROM pg_stat_database where datname is not null) T