PostgreSQL 16 Flexible Server: How to remove automatic azuresu-granted creator role memberships?

Taufiq ALblooshi 0 Reputation points
2026-09-16T14:40:04.4766667+00:00

We need guidance on a PostgreSQL 16 role-provisioning issue in a non-production Azure Database for PostgreSQL Flexible Server environment.

Environment:

  • Azure Database for PostgreSQL Flexible Server
  • PostgreSQL 16
  • Customer administrator: bemtechadmin, member of azure_pg_admin

We intend to create two ordinary non-superuser application roles:

  • bemtech_schema_owner: NOLOGIN role used as database/schema/object owner
  • bemtech_app_runtime: restricted LOGIN runtime role

PostgreSQL 16 automatically creates creator membership in each newly created role with:

member = bemtechadmin grantor = azuresu ADMIN OPTION = true INHERIT OPTION = false SET OPTION = false

Our security requirement is that after bootstrap, bemtechadmin must have zero residual membership in either application role, regardless of grantor or membership options.

Our investigation indicates that an ordinary REVOKE by bemtechadmin may not remove the automatic membership granted by azuresu, while the customer administrator cannot act as azuresu.

What is the officially supported method on Azure Database for PostgreSQL Flexible Server / PostgreSQL 16 to:

  1. Create these roles without the automatic azuresu-granted creator membership; or
  2. Remove that membership afterward; or
  3. Use another supported provisioning pattern that leaves bemtechadmin with zero membership while retaining a NOLOGIN owner role and restricted LOGIN runtime role?

We are not requesting superuser access or broader Azure RBAC.

Please provide the supported SQL commands or Azure procedure, required privileges, and a verification query showing that no residual membership remains.We need guidance on a PostgreSQL 16 role-provisioning issue in a non-production Azure Database for PostgreSQL Flexible Server environment.

Environment:

  • Azure Database for PostgreSQL Flexible Server
  • PostgreSQL 16
  • Customer administrator: bemtechadmin, member of azure_pg_admin

We intend to create two ordinary non-superuser application roles:

  • bemtech_schema_owner: NOLOGIN role used as database/schema/object owner
  • bemtech_app_runtime: restricted LOGIN runtime role

PostgreSQL 16 automatically creates creator membership in each newly created role with:

member = bemtechadmin
grantor = azuresu
ADMIN OPTION = true
INHERIT OPTION = false
SET OPTION = false

Our security requirement is that after bootstrap, bemtechadmin must have zero residual membership in either application role, regardless of grantor or membership options.

Our investigation indicates that an ordinary REVOKE by bemtechadmin may not remove the automatic membership granted by azuresu, while the customer administrator cannot act as azuresu.

What is the officially supported method on Azure Database for PostgreSQL Flexible Server / PostgreSQL 16 to:

  1. Create these roles without the automatic azuresu-granted creator membership; or
  2. Remove that membership afterward; or
  3. Use another supported provisioning pattern that leaves bemtechadmin with zero membership while retaining a NOLOGIN owner role and restricted LOGIN runtime role?

We are not requesting superuser access or broader Azure RBAC.

Please provide the supported SQL commands or Azure procedure, required privileges, and a verification query showing that no residual membership remains.

Azure Database for PostgreSQL
0 comments No comments

1 answer

Sort by: Newest
  1. Allan Solomon Mejia 9,085 Reputation points
    2026-09-16T21:40:55.93+00:00

    Hi @Taufiq ALblooshi

    What you're seeing is expected PostgreSQL 16 role-management behavior, rather than an Azure RBAC assignment.

    In PostgreSQL 16, when a non-superuser with CREATEROLE creates another role, the creator implicitly receives ADMIN OPTION on that role. PostgreSQL records this automatic grant as coming from the bootstrap superuser.

    That explains the membership you're seeing:

    member = bemtechadmin

    grantor = azuresu

    ADMIN = true

    INHERIT = false

    SET = false

    Importantly, PostgreSQL's documentation states that the CREATEROLE user can't remove or modify this bootstrap-superuser grant; only a superuser can.

    On Azure Database for PostgreSQL Flexible Server, customers aren't given the azuresu superuser role. Microsoft reserves that role for managed-service/control-plane operations, while the server administrator is NOSUPERUSER with CREATEROLE and membership in azure_pg_admin.

    So I don't see a supported customer-side SQL command that lets bemtechadmin remove this particular azuresu-granted creator membership while remaining the role creator.

    One useful distinction, though, is that the membership shown here has:

    INHERIT = false

    SET = false

    Therefore, bemtechadmin does not automatically inherit the application's privileges and cannot SET ROLE to that role through this membership. ADMIN OPTION gives it role-administration capability, but isn't equivalent to inheriting or assuming the application's runtime permissions. PostgreSQL 16 separates these membership options explicitly.

    You can verify the exact relationship with:

    SELECT
        r.rolname AS role_name,
        m.rolname AS member,
        g.rolname AS grantor,
        am.admin_option,
        am.inherit_option,
        am.set_option
    FROM pg_auth_members am
    JOIN pg_roles r ON r.oid = am.roleid
    JOIN pg_roles m ON m.oid = am.member
    JOIN pg_roles g ON g.oid = am.grantor
    WHERE r.rolname IN ('bemtech_schema_owner',
                        'bemtech_app_runtime');
    

    pg_auth_members is the PostgreSQL catalog containing the grantor and the three membership-option states.

    If your compliance requirement literally requires zero rows in pg_auth_members connecting bemtechadmin to those roles, rather than simply preventing privilege inheritance/impersonation, raise this with Azure Database for PostgreSQL Support. The PostgreSQL 16 bootstrap grant, plus Azure's restriction on customer superuser access, means a normal REVOKE by bemtechadmin can't satisfy that requirement.

    References:

    Access management in Azure Database for PostgreSQL Flexible Server

    Manage users in Azure Database for PostgreSQL Flexible Server

    PostgreSQL 16 - CREATE ROLE

    PostgreSQL 16 - Role membership

    PostgreSQL 16 – pg_auth_members


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.

    Was this answer helpful?


Your answer

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