Report this

What is the reason for this report?

Assigning pg_monitor role to users in managed PostgreSQL database

Posted on October 10, 2025

Hi,

I’d like to assign the pg_monitor role to a user I created for myself in a managed PostgreSQL database. The problem I’m encountering is that neither db nor doadmin have the necessary permissions to grant this role to a new user.

db=> GRANT pg_monitor to doadmin with ADMIN OPTION;
ERROR:  must have admin option on role "pg_monitor"

I’d like to use an external tool to monitor several database metrics instead of DigitalOcean’s built-in method.

Other managed offerings provide operators with the means to assign this role, how about DigitalOcean?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

As far as I know, DigitalOcean Managed PostgreSQL doesn’t allow granting system roles like pg_monitor, since users don’t have full superuser privileges. It seems those roles are reserved for internal management and stability reasons.

You could still use built-in metrics or query views like pg_stat_activity for monitoring. If you’d like more flexibility, it might be worth sharing the request with the product team here: https://ideas.digitalocean.com/

Hi Taha,

In DigitalOcean Managed PostgreSQL, certain superuser-level roles like pg_monitor are restricted for security reasons. Unlike self-managed PostgreSQL instances, you cannot directly grant pg_monitor to other users because doadmin itself does not have full superuser privileges.

If you want to monitor metrics externally:

  1. Use DigitalOcean’s Metrics & Monitoring API, which exposes key database stats.

  2. Connect via a read-only user to query system views that are accessible without pg_monitor (e.g., pg_stat_activity, pg_stat_database).

  3. Consider using a monitoring agent or external tool (like pgDash, Datadog, or pgAdmin) that works with the privileges available to doadmin.

Essentially, DigitalOcean’s managed environment does not allow granting pg_monitor for security isolation — the built-in monitoring is the recommended approach.

You can usually assign the pg_monitor role with a simple GRANT pg_monitor TO username;. Just make sure your managed PostgreSQL allows role changes, as some providers restrict superuser-level modifications.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.