# Postgres privileges

**URL:** <https://discuss.elastic.co/t/postgres-privileges/144603>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 16, 2018, 12:54am UTC](https://discuss.elastic.co/t/postgres-privileges/144603 "2018-08-16T00:54:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshsmoore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshsmoore/32/31581_2.png) [@joshsmoore](https://discuss.elastic.co/u/joshsmoore)\
**Post date:** [August 16, 2018, 12:54am UTC](https://discuss.elastic.co/t/postgres-privileges/144603/1 "2018-08-16T00:54:33Z")

</div>

Hi have setup the Postgres module and it seems to be working correctly with one exception.

> postgresql.activity.query:

Can you tell me what privilege I need to set on this user to fix this?

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [August 16, 2018, 1:01pm UTC](https://discuss.elastic.co/t/postgres-privileges/144603/2 "2018-08-16T13:01:50Z")

</div>

Hi @joshsmoore,

I think the user needs select on `pg_stat_activity` to get its own activity, but it needs superuser privileges to get the activity of all connections.

In any case, could you share the complete error message you are receiving if possible?

---

<div class="post-metadata">

**Author:** ![StephenGoodall](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@StephenGoodall](https://discuss.elastic.co/u/StephenGoodall)\
**Post date:** [August 21, 2018, 4:47am UTC](https://discuss.elastic.co/t/postgres-privileges/144603/3 "2018-08-21T04:47:11Z")

</div>

Sorry to piggyback on this thread (it seems somewhat related) but is there a set of minimum privileges that are needed for the Postgres module? I don't think the security team would like using the root user 😃

If there is a set, could it be added to the documentation? Happy to raise in GitHub if needed,

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 21, 2018, 7:12am UTC](https://discuss.elastic.co/t/postgres-privileges/144603/4 "2018-08-21T07:12:01Z")

</div>

@StephenGoodall Yes, please open a Github issue as I agree would be great to have it in the docs (even if it is root).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 18, 2018, 7:12am UTC](https://discuss.elastic.co/t/postgres-privileges/144603/5 "2018-09-18T07:12:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
