diff --git a/postgres/datadog_checks/postgres/util.py b/postgres/datadog_checks/postgres/util.py index 2d159e2bbd41b..6450da3fc2e0e 100644 --- a/postgres/datadog_checks/postgres/util.py +++ b/postgres/datadog_checks/postgres/util.py @@ -332,7 +332,7 @@ def get_schema_field(descriptors): TX_METRICS = { 'name': 'pg_snapshot_xmin', - 'query': "pg_snapshot_xmin(pg_current_snapshot())", + 'query': "select pg_snapshot_xmin(pg_current_snapshot())", 'columns': [ {'name': 'postgresql.transactions.xid', 'type': 'gauge'}, ], @@ -340,7 +340,7 @@ def get_schema_field(descriptors): TX_METRICS_LT_13 = { 'name': 'pg_snapshot_xmin', - 'query': "txid_snapshot_xmin(txid_current_snapshot())", + 'query': "select txid_snapshot_xmin(txid_current_snapshot())", 'columns': [ {'name': 'postgresql.transactions.xid', 'type': 'gauge'}, ], diff --git a/postgres/tests/test_pg_integration.py b/postgres/tests/test_pg_integration.py index 4fcbabf350f4d..45dc7551f5748 100644 --- a/postgres/tests/test_pg_integration.py +++ b/postgres/tests/test_pg_integration.py @@ -36,7 +36,6 @@ requires_static_version, ) from .utils import requires_over_10, requires_over_13, requires_over_14 -from .utils import requires_over_10 CONNECTION_METRICS = ['postgresql.max_connections', 'postgresql.percent_usage_connections']