Search code examples
postgresqlherokuheroku-postgresdatadog

How can I add pg_monitor role to a postgresql user on heroku


I'm trying to set up a Datadog PostgreSQL integration that requires a user with pg_monitor role and SELECT permission on pg_stat_database as described on their own documentation.

My database is currently hosted on Heroku and it seems the default user doesn't have SUPERUSERpermissions because, when I try to apply the above role and permission to a "monitor" user I have the following error message:

ERROR: must have admin option on role "pg_monitor"

So I'm looking for some way of:

  • grant the necessary permissions to that user without being a superuser
  • get superuser access on Heroku Postgres (what I think is not possible)

Someone has ever faced this issue? There is a way to handle this case?


Solution

  • I had to open a ticket asking the Heroku CS team to apply the "pg_monitor" role to my user. They've granted the role and now everything is working fine