-
Patch request
-
Resolution: Fixed
-
Trivial
-
5.0.1, 5.2.0alpha1
-
Sprint 65 (Jun 2020), Sprint 66 (Jul 2020), Sprint 67 (Aug 2020), Sprint 68 (Sep 2020), Sprint 69 (Oct 2020), Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021), Sprint 74 (Mar 2021)
-
0.1
Steps to reproduce:
- Install postgresql 12
- Add official postgresql monitoring https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql
Result:
In postgresql log we see constantly
2020-06-24 17:21:22 EEST ERROR: field name must not be null
2020-06-24 17:21:22 EEST STATEMENT: SELECT json_object_agg(datname, row_to_json(T)) FROM (
SELECT datname,
numbackends,
xact_commit,
xact_rollback,
blks_read,
blks_hit,
tup_returned,
tup_fetched,
tup_inserted,
tup_updated,
tup_deleted,
conflicts,
temp_files,
temp_bytes,
deadlocks
FROM pg_stat_database) T
Expected:
no entries in the logs
The reason is that in Postgresql 12 the pg_stat_database
has one more line that is agregate for all databases
The pg_stat_database view will contain one row for each database in the cluster, plus one for the shared objects, showing database-wide statistics.
The fix is prety easy ... just add WHERE datname IS NOT NULL in pgsql.dbstat.sql
- duplicates
-
ZBX-17785 pgsql.dbstat.sql from the official Template DB PostgreSQL causes error
- Closed