diff --git a/postgres/datadog_checks/postgres/postgres.py b/postgres/datadog_checks/postgres/postgres.py index 5a2927b1ea0c7..08e7af8c6b3b4 100644 --- a/postgres/datadog_checks/postgres/postgres.py +++ b/postgres/datadog_checks/postgres/postgres.py @@ -168,7 +168,10 @@ def _new_query_executor(self, queries): ) def execute_query_raw(self, query): - return self.db_pool.execute_main_db_safe(query) + with self.db.cursor() as cursor: + cursor.execute(query) + rows = cursor.fetchall() + return rows @property def dynamic_queries(self):