Thank you for being patient while checking on this.
The issue is due to PostgreSQL 16 changes to role permissions. In PostgreSQL 16, the grantor of a role cannot be changed, and you can't drop admin_wi as it's still the grantor of test role. Here's a workaround you can follow:
Workaround:
1.Revoke & Regrant Role:
REVOKE testrole FROM azure_pg_admin;
GRANT testrole TO azure_pg_admin WITH ADMIN OPTION;
2. Verify the Grantor:
SELECT roleid::regrole, member::regrole, grantor::regrole, admin_option
FROM pg_auth_members
WHERE roleid = 'testrole'::regrole;
3. Drop admin_wi:
DROP ROLE admin_wi;
After reassigning, you should be able to drop admin_wi.
After reassigning the grantor, you should be able to drop admin_wi. If you need more details on these changes, you can refer to the PostgreSQL 16 Release Notes.
Please let us know the result.
Regards,
Oury