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.
A simple patch solves the problem