DEV Community

Cover image for Upgrade a User to be a Super User
Sergio Diaz
Sergio Diaz

Posted on

Upgrade a User to be a Super User

In terminal run

sudo su postgres
Enter fullscreen mode Exit fullscreen mode

After typing your password and getting in postgres type:

psql
Enter fullscreen mode Exit fullscreen mode

Type your postgres password. Once you are in psql run

\du
Enter fullscreen mode Exit fullscreen mode

to see all your users. Notice the table that is displayed, and pay attention to the List of roles attributes column.

Once you know what user you are giving super user permissions, run:

ALTER USER <user> SUPERUSER;
Enter fullscreen mode Exit fullscreen mode

To confirm the changes run again \du. You should see your user with the new role Superuser.

That's it, hope this help someone!

Photo by Mehdi Babousan on Unsplash

Top comments (0)