Error dropping role with no members and no admin

GregF 10 Reputation points
2025-03-20T18:33:04.6566667+00:00

I have a role that cannot be deleted. It has no members and is not granted to any other roles.

When I try to drop it as my admin user, I receive the error.

ERROR: permission denied to drop role

DETAIL: Only roles with the CREATEROLE attribute and the ADMIN option on role "test_svc_account" may drop this role

We are using Azure database for PostgreSQL 16.4

How can I get rid of this role?

Azure Database for PostgreSQL
{count} vote

1 answer

Sort by: Most helpful
  1. GregF 10 Reputation points
    2025-04-18T11:42:25.8566667+00:00

    The solution for my specific case is that Azure technical support dropped the orphaned role on my behalf. This is definitely a shortcoming of Azure database for PostgreSQL, and DBAs need to take measures to ensure they do not to fall into this situation.

    0 comments No comments

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.