How to delete PG user when they have no ADMIN OWNER

Brenwell 0 Reputation points
2025-03-27T12:02:48.1233333+00:00

I have a Azure Flexible Postgres Server and I have a user I want to delete. However I am not the superuser because that is Azure itself. I am a member of the azure_pg_admin group. But for some unknow reason the user has no ADMIN OWNER

How could I possibly delete them?

Query 1 ERROR at Line 1: : ERROR:  permission denied to drop role

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

Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. PratikLad 1,825 Reputation points Microsoft External Staff Moderator
    2025-04-17T03:45:41.47+00:00

    Hi Brenwell,

    We’ve identified a limitation in PostgreSQL 16 that affects role management. Please refer to the following documentation for details: https://www.postgresql.org/docs/16/release-16.html

    In PostgreSQL 16, roles with the CREATEROLE privilege can no longer modify certain attributes of non-superuser roles unless they also have the ADMIN OPTION. This includes the ability to change properties such as CREATEDB, REPLICATION, and BYPASSRLS, or to manage role memberships.

    To address the issue of the orphaned role, Azure technical support will need to enable the necessary permissions on the backend. Once this is done, you should be able to drop the affected roles successfully.

    0 comments No comments

  2. Brenwell 0 Reputation points
    2025-05-19T14:31:12.64+00:00

    The solution is - you need to get someone from support to help you

    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.