CREATE SUPERUSER in PaaS offering of Azure Database for Postgres

MS Techie 2,671 Reputation points
2020-10-08T16:09:49.957+00:00

Hi,

i logged into the azure Postgres database , with the admin user credentials , that i gave at the time of creating the Azure Database for Postgres

Now when i try to create SUPERUSER , by giving the command
CREATE USER TESTER SUPERUSER; ---> it gives me error saying
must be superuser to create superusers

I was thinking , the ADMIN USER that i created for Azure Database for Postgres is itself the SUPER USER. Can we not create SUPER USERS in Azure Database for PostgreSQL

Please help

Azure Database for PostgreSQL
0 comments No comments
{count} votes

Accepted answer
  1. MS Techie 2,671 Reputation points
    2020-10-08T16:39:36.177+00:00

    I figured out the answer myself.

    In Azure Postgres , we cannot CREATE SUPERUSERS . Since this is a Managed Service , Only Microsoft is part of SUPERUSERS Group
    Details in link here

    The Azure Database for PostgreSQL server is created with the 3 default roles defined. You can see these roles by running the command: SELECT rolname FROM pg_roles;

    azure_pg_admin
    azure_superuser
    your server admin user
    Your server admin user is a member of the azure_pg_admin role. However, the server admin account is not part of the azure_superuser role. Since this service is a managed PaaS service, only Microsoft is part of the super user role.

    5 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Manish Kumar Singh 1 Reputation point
    2022-09-21T15:17:00.237+00:00

    When we postgres as service then we cannot be superuser but can enable extensions allowed

    Azure console => Azure Database for PostgreSQL flexible server => <Database> => Server parameters => azure.extensions => <Select extensions> => Save

    243488-image.png