Admin user can't access user databases

2024-07-02T09:15:47.07+00:00

Hey,
I have migrated from single server to flexible server using database migration service

I am having this following issue
the admin user creates user using

CREATE USER new_user WITH ENCRYPTED PASSWORD {};
next, GRANT ALL PRIVILEGES ON DATABASE new_db TO new_user;

now the problem is that new_user has access to the new_db but the admin_user doesn't
isn't the point of admin user is to have access to all database objects ?

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Deepanshukatara-6769 7,905 Reputation points
    2024-07-02T11:34:59.5033333+00:00

    Hi,

    That is by design the admin will need to be part of the role role_developer Please add your admin_user under membership as shown below and give it a try.

    So basically we can explicitly assign rights or ownership of DB object to the required user i.e admin user

    202877-image.png

    for ref --> please check https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-create-users

    Please let me know if this helps or if you need any additional information.

    Regards