how to change user to superuser in postgresql

How To Change User to Superuser in PostgreSQL

Sometimes you may need to change user to superuser in PostgreSQL. In this article, we will look at how to change user to superuser in PostgreSQL.


How To Change User to Superuser in PostgreSQL

It is really easy to change user to superuser as well as change superuser to regular user in PostgreSQL.

Log into PostgreSQL and run the following ALTER USER command to change user test_user to superuser. Replace test_user with username as per your requirement.

postgres-# ALTER USER test_user WITH SUPERUSER;

In the above command, we use WITH SUPERUSER clause to change user to superuser.

Similarly, run the following ALTER USER command to remove superuser privilege from a user. In this case use WITH NOSUPERUSER clause.

postgres-# ALTER USER test_user WITH NOSUPERUSER;

That’s it. As you can see it is really easy to change user to superuser and a superuser to regular user in PostgreSQL. Ubiq makes it easy to visualize data, and monitor them in real-time dashboards. Try Ubiq for free.

mm

About Ubiq

Ubiq is a powerful dashboard & reporting platform. Build dashboards, charts & reports for your business in minutes. Try it for free!