# PMM Query Analytics for Postgres & Aurora Postgres

**URL:** <https://forums.percona.com/t/pmm-query-analytics-for-postgres-aurora-postgres/7235>\
**Category:** PMM 1.x\
**Created:** [October 11, 2019, 3:32am UTC](https://forums.percona.com/t/pmm-query-analytics-for-postgres-aurora-postgres/7235 "2019-10-11T03:32:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suvkum](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@suvkum](https://forums.percona.com/u/suvkum)\
**Post date:** [October 11, 2019, 3:32am UTC](https://forums.percona.com/t/pmm-query-analytics-for-postgres-aurora-postgres/7235/1 "2019-10-11T03:32:53Z")

</div>

Did anyone tried query analytics for postgres and RDS? In status for qan-postgresql-pgstatements-agent it show Waiting.

Agent type Status Agent ID Service ID  
pmm-agent connected /agent\_id/03b9432d-1492-45d2-959b-0519047d3c5d  
node\_exporter running /agent\_id/e011ddd1-bdc8-43b3-98de-710344eb0ec2  
postgres\_exporter running /agent\_id/8acd987f-9f76-4ad1-87b9-a995e6d09c04 /service\_id/87fc07a8-ea20-4ca3-a4f9-85da82816e56

qan-postgresql-pgstatements-agent waiting /agent\_id/7a3565e9-c513-4c69-8b51-cf96e48e40ed /service\_id/87fc07a8-ea20-4ca3-a4f9-85da82816e56

---

<div class="post-metadata">

**Author:** ![margaash](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@margaash](https://forums.percona.com/u/margaash)\
**Post date:** [October 22, 2019, 10:33am UTC](https://forums.percona.com/t/pmm-query-analytics-for-postgres-aurora-postgres/7235/2 "2019-10-22T10:33:00Z")

</div>

I have exactly the same behaviour with PostgreSQL 11.4. If you managed to identify the problem or misconfiguration, please let me know.

Thanks!

---

<div class="post-metadata">

**Author:** ![margaash](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@margaash](https://forums.percona.com/u/margaash)\
**Post date:** [October 23, 2019, 10:12am UTC](https://forums.percona.com/t/pmm-query-analytics-for-postgres-aurora-postgres/7235/3 "2019-10-23T10:12:50Z")

</div>

I had the same problem: I was not creating the pg\_stat\_statements extension in the right database.

This:  
CREATE EXTENSION pg\_stat\_statements SCHEMA public;  
has to be executed in the database used by pmm, which is the one with the same name as the username specified in the ‘pmm-admin add postgresql’ command.

For more details, see:  
[URL][https://www.percona.com/forums/questions-discussions/percona-monitoring-and-management/54792-pmm-postgres\_exporter-returns-database-does-not-exist[/URL]](https://www.percona.com/forums/questions-discussions/percona-monitoring-and-management/54792-pmm-postgres_exporter-returns-database-does-not-exist%5B/URL%5D)

Hope it helps.
