You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/database_monitoring/setup_postgres/troubleshooting.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,24 @@ psql -h localhost -U datadog -d postgres -c "select * from pg_stat_statements LI
97
97
98
98
If you specified a `dbname` other than the default `postgres` in your Agent config, you must run `CREATE EXTENSION pg_stat_statements` in that database.
99
99
100
+
If you created the extension in your target database and you still see this warning, the extension may have been created in a schema that is not accessible to the `datadog` user. To verify this, run this command to check which schema `pg_stat_statements` was created in:
101
+
102
+
```bash
103
+
psql -h localhost -U datadog -d postgres -c "select nspname from pg_extension, pg_namespace where extname = 'pg_stat_statements' and pg_extension.extnamespace = pg_namespace.oid;"
104
+
```
105
+
106
+
Then, run this command to check which schemas are visible to the `datadog` user:
If you do not see the `pg_stat_statements` schema in the `datadog` user's `search_path`, you need to add it to the `datadog` user. For example:
113
+
114
+
```sql
115
+
ALTER ROLE datadog SET search_path ="$user",public,schema_with_pg_stat_statements;
116
+
```
117
+
100
118
### Certain queries are missing
101
119
102
120
If you have data from some queries, but do not see a particular query or set of queries in Database Monitoring that you're expecting to see , follow this guide.
@@ -239,4 +257,4 @@ For more information, see the appropriate version of the [Postgres `contrib` doc
0 commit comments