From 4ae07abf5f01fa427bb406c6a3cee7a03f14d43e Mon Sep 17 00:00:00 2001 From: Nick Carboni Date: Thu, 7 Feb 2019 15:04:33 -0500 Subject: [PATCH] Replace waiting column with wait_event_type and wait_event The pg_stat_activity view changed in PG 9.6 Fixes #13200 --- lib/extensions/ar_adapter/ar_dba.rb | 3 ++- spec/models/vmdb_database_spec.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/extensions/ar_adapter/ar_dba.rb b/lib/extensions/ar_adapter/ar_dba.rb index e44024a49122..c0deade972f9 100644 --- a/lib/extensions/ar_adapter/ar_dba.rb +++ b/lib/extensions/ar_adapter/ar_dba.rb @@ -24,7 +24,8 @@ def client_connections SELECT client_addr AS client_address , datname AS database , pid AS spid - , waiting AS is_waiting + , wait_event_type + , wait_event , query FROM pg_stat_activity ORDER BY 1, 2 diff --git a/spec/models/vmdb_database_spec.rb b/spec/models/vmdb_database_spec.rb index ff80fb8e2816..729e6ae298b8 100644 --- a/spec/models/vmdb_database_spec.rb +++ b/spec/models/vmdb_database_spec.rb @@ -89,7 +89,7 @@ connections = described_class.report_client_connections expect(connections).to be_kind_of(Array) - expected_keys = ["client_address", "database", "spid", "is_waiting", "query"] + expected_keys = ["client_address", "database", "spid", "wait_event_type", "wait_event", "query"] expect(connections.first.keys).to match_array(expected_keys) expect(connections.first['spid']).to be_kind_of(Integer)