# Postgres and seeing other schemas/roles/databases

**URL:** <https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202>\
**Category:** PMM 2.x\
**Created:** [October 27, 2020, 9:03pm UTC](https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202 "2020-10-27T21:03:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwolfe19](https://avatars.discourse-cdn.com/v4/letter/k/439d5e/32.png) [@kwolfe19](https://forums.percona.com/u/kwolfe19)\
**Post date:** [October 27, 2020, 9:03pm UTC](https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202/1 "2020-10-27T21:03:41Z")

</div>

So I’ve got PMM set up and I can see certain things, but I can’t (in QAN) see everything. I can see the pmm\_user and postgres database for example, but I cannot see the database where all of my schemas (and tables are). I also can not see any of the other users/roles. I am guessing this is a missing role/permission thing from pmm\_user. I can see queries that are being run by pmm\_user through QAN. Any idea on what I need to do to be able to see the details about the other databases and schemas?

I am running Postgres 9.6 hosted in GCP, and it is DaaS.

Thank you!

---

<div class="post-metadata">

**Author:** ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)\
**Post date:** [October 29, 2020, 10:23am UTC](https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202/2 "2020-10-29T10:23:59Z")

</div>

Hi,

Can you send the exact steps you used to install and configure this PMM client with QAN? Please send steps used for OS and PostgreSQL commands. For your reference, let me send one documentation link and one blogpost that can help you with the steps needed, in case you missed any:

[https://www.percona.com/doc/percona-monitoring-and-management/2.x/manage/conf-postgres.html](https://www.percona.com/doc/percona-monitoring-and-management/2.x/manage/conf-postgres.html)

[https://www.percona.com/blog/2019/10/29/monitoring-postgresql-databases-using-percona-monitoring-management](https://www.percona.com/blog/2019/10/29/monitoring-postgresql-databases-using-percona-monitoring-management)

In particular, does the user have SUPERUSER level access? ([https://www.percona.com/doc/percona-monitoring-and-management/2.x/manage/conf-postgres.html#prerequisites](https://www.percona.com/doc/percona-monitoring-and-management/2.x/manage/conf-postgres.html#prerequisites))

---

<div class="post-metadata">

**Author:** ![kwolfe19](https://avatars.discourse-cdn.com/v4/letter/k/439d5e/32.png) [@kwolfe19](https://forums.percona.com/u/kwolfe19)\
**Post date:** [October 29, 2020, 12:12pm UTC](https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202/3 "2020-10-29T12:12:29Z")

</div>

Since we’re a managed Google Cloud instance we can’t give SUPERUSER to pmm\_user. Instead we’ve followed (mostly) this one: [https://www.percona.com/blog/2020/09/22/using-security-definer-to-monitor-postgresql-9-6-or-earlier-using-percona-monitoring-and-management/](https://www.percona.com/blog/2020/09/22/using-security-definer-to-monitor-postgresql-9-6-or-earlier-using-percona-monitoring-and-management/)

We had to do a few things differently though because (I think) PMM now logs in to the postgres database. So I enabled the pg\_stat\_statements in the postgres database and created the functions there as well. When I followed the directions in a separate pmm database the QAN agent would not start.

On permissions for the pmm\_user, that user was created through psql so it does not have all of the administrator privileges that a user created through google’s CLI would have. I can recreate the user if needed though.

---

<div class="post-metadata">

**Author:** ![kwolfe19](https://avatars.discourse-cdn.com/v4/letter/k/439d5e/32.png) [@kwolfe19](https://forums.percona.com/u/kwolfe19)\
**Post date:** [November 2, 2020, 12:45pm UTC](https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202/4 "2020-11-02T12:45:55Z")

</div>

Any ideas on this? I have posted the steps.

---

<div class="post-metadata">

**Author:** ![Jobin\_Augustine](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jobin_augustine/32/1275_2.png) [@Jobin\_Augustine](https://forums.percona.com/u/Jobin_Augustine)\
**Post date:** [December 3, 2020, 9:25am UTC](https://forums.percona.com/t/postgres-and-seeing-other-schemas-roles-databases/8202/5 "2020-12-03T09:25:58Z")

</div>

Hi [kwolfe19](https://forums.percona.com/profile/kwolfe19)The QAN picks of information from pg\_stat\_statements using the same user which we used for adding the monitoring configuration.

For example, if I use a statement like:

```auto
sudo pmm-admin add postgresql --username=pmm --password=pmm --environment=versions --query-source=pgstatmonitor

```

The user “pmm” should be existing in database and should have access to pg\_stat\_statements. So please connect to command line tool (psql) as the same user and make sure that you are able to see the same information in pg\_stat\_statements. it is appearing while directly querying the pg\_stat\_statements view, It should be appearing in PMM as well. You may adjust the duration of the monitoring to a small value (for example, 5 mintues) for example to make sure that you have the same information from both pg\_stat\_statements and QAN.

 ![Screenshot from 2020-12-03 20-23-24.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/56e226037f67b5f7829490ed309c0d167315e7e4.png)
