Skip to content

Commit 8308a17

Browse files
committed
fix: added NOT NULL check to pg_locks.relation
1 parent 837db9e commit 8308a17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mamonsu/plugins/pgsql/databases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Databases(Plugin):
2121
"FROM pg_catalog.pg_class, pg_catalog.pg_index " \
2222
"WHERE pg_catalog.pg_index.indisvalid = false " \
2323
"AND pg_catalog.pg_index.indexrelid = pg_catalog.pg_class.oid " \
24-
"AND pg_catalog.pg_index.indexrelid NOT IN (SELECT DISTINCT relation FROM pg_catalog.pg_locks);"
24+
"AND pg_catalog.pg_index.indexrelid NOT IN (SELECT DISTINCT relation FROM pg_catalog.pg_locks WHERE relation IS NOT NULL);"
2525

2626
# queries for zabbix agent
2727
query_agent_discovery = "SELECT json_build_object ('data',json_agg(json_build_object('{#DATABASE}',d.datname)))" \

0 commit comments

Comments
 (0)