Azure PostgreSQL Flexible server: Unable to drop roles

Peter Koller 45 Reputation points
2024-04-10T13:20:19.3+00:00

We are having some weird issues when trying to remove roles. I am connected as the admin user that is member of azure_pg_admin. When trying to remove a role with

DROP ROLE role_to_drop

We get the error "Could not drop the role. Only roles with the CREATEROLE attribute and the ADMIN option on role "role_to_drop" may drop this role.permission denied to drop role"

Anyone know how to fix this?

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,492 Reputation points Microsoft Employee
    2024-04-10T18:38:40.88+00:00

    Hi, @Peter Koller If the Admin has created the custom role, then with the admin access you should be able to drop. as we have limitation on Postgres 16, please check the below document.

    Previously roles with CREATEROLE privileges could change many aspects of any non-superuser role. Such changes, including adding members, now require the role requesting the change to have ADMIN OPTION permission. For example, they can now change the CREATEDB, REPLICATION, and BYPASSRLS properties only if they also have those permissions.

    https://www.postgresql.org/docs/16/release-16.html

    User's image

    Regards

    Geetha


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.