# erro monitoring Postgresql 10

**URL:** <https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493>\
**Category:** Help\
**Tags:** configuration, agent, collectors\
**Created:** [November 7, 2022, 1:07pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493 "2022-11-07T13:07:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo\_Buch](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/rodrigo_buch/32/2278_2.png) [@Rodrigo\_Buch](https://community.netdata.cloud/u/Rodrigo_Buch)\
**Post date:** [November 7, 2022, 1:07pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493/1 "2022-11-07T13:07:03Z")

</div>

I configured netdata to monitor Postgresql and it is giving these errors in the log, I ran GRANT SELECT ON ALL TABLES IN SCHEMA pgagent TO netdata; in the postgres table but not resolved.

2022-11-07 10:00:02.245 -03 [1107866] netdata@postgres ERROR: permission denied for schema pgagent  
2022-11-07 10:00:02.245 -03 [1107866] netdata@postgres STATEMENT:  
SELECT current\_database() as dataname,  
schemaname,  
relname,  
seq\_scan,  
seq\_tup\_read,  
idx\_scan,  
idx\_tup\_fetch,  
n\_tup\_ins,  
n\_tup\_upd,  
n\_tup\_del,  
n\_tup\_hot\_upd,  
n\_live\_tup,  
n\_dead\_tup,  
EXTRACT(epoch from now() - last\_vacuum) as last\_vacuum,  
EXTRACT(epoch from now() - last\_autovacuum) as last\_autovacuum,  
EXTRACT(epoch from now() - last\_analyze) as last\_analyze,  
EXTRACT(epoch from now() - last\_autoanalyze) as last\_autoanalyze,  
vacuum\_count,  
autovacuum\_count,  
analyze\_count,  
autoanalyze\_count,  
pg\_total\_relation\_size(schemaname || ‘.’ || relname) as total\_relation\_size  
FROM pg\_stat\_user\_tables;

---

<div class="post-metadata">

**Author:** ![Shyam](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/shyam/32/1510_2.png) [@Shyam](https://community.netdata.cloud/u/Shyam)\
**Post date:** [November 10, 2022, 5:19pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493/2 "2022-11-10T17:19:38Z")

</div>

Have you granted pg\_monitor access to netdata?

GRANT pg\_monitor TO netdata;

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Buch](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/rodrigo_buch/32/2278_2.png) [@Rodrigo\_Buch](https://community.netdata.cloud/u/Rodrigo_Buch)\
**Post date:** [November 10, 2022, 5:53pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493/3 "2022-11-10T17:53:10Z")

</div>

@Shyam  
yes still continue  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/2X/1/1419f8f3c46501d33511c68a6e78a796e6d2567f.png)

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/2X/4/4bd4e1990a8391c64bed124d36be7e9f3acae63e.png)

---

<div class="post-metadata">

**Author:** ![Shyam](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/shyam/32/1510_2.png) [@Shyam](https://community.netdata.cloud/u/Shyam)\
**Post date:** [November 10, 2022, 6:04pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493/4 "2022-11-10T18:04:50Z")

</div>

@Rodrigo_Buch Hmm, this is weird. I wonder if it could have something to do with this.

[**System/database access**](https://www.pgadmin.org/docs/pgadmin4/development/using_pgagent.html#security-concerns) - all jobs run by pgAgent will run with the security privileges of the pgAgent user. SQL steps will run as the user that pgAgent connects to the database as, and batch/shell scripts will run as the operating system user that the pgAgent service or daemon is running under. Because of this, it is essential to maintain control over the users that are able to create and modify jobs. **By default, only the user that created the pgAgent database objects will be able to do this - this will normally be the PostgreSQL superuser.**

---

<div class="post-metadata">

**Author:** ![Shyam](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/shyam/32/1510_2.png) [@Shyam](https://community.netdata.cloud/u/Shyam)\
**Post date:** [November 10, 2022, 6:07pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493/5 "2022-11-10T18:07:05Z")

</div>

@Rodrigo_Buch please submit an issue at [netdata/netdata](https://github.com/netdata/netdata/issues/) and we’ll try and get a fix out soon so Netdata doesn’t error out in this scenario.

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Buch](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/rodrigo_buch/32/2278_2.png) [@Rodrigo\_Buch](https://community.netdata.cloud/u/Rodrigo_Buch)\
**Post date:** [November 10, 2022, 6:08pm UTC](https://community.netdata.cloud/t/erro-monitoring-postgresql-10/3493/6 "2022-11-10T18:08:30Z")

</div>

@Shyam Thank you for the explanation.
