postgres: upgrade a user to be a superuser?

后端 未结 7 1038
别那么骄傲
别那么骄傲 2021-01-29 17:03

In postgres, how do I change an existing user to be a superuser? I don\'t want to delete the existing user, for various reasons.

# alter user myuser ...?
         


        
7条回答
  •  生来不讨喜
    2021-01-29 17:32

    To expand on the above and make a quick reference:

    • To make a user a SuperUser: ALTER USER username WITH SUPERUSER;
    • To make a user no longer a SuperUser: ALTER USER username WITH NOSUPERUSER;
    • To just allow the user to create a database: ALTER USER username CREATEDB;

    You can also use CREATEROLE and CREATEUSER to allow a user privileges without making them a superuser.

    Documentation

提交回复
热议问题