How to do it…

  1. A user becomes a superuser when it is created with the SUPERUSER attribute set:
CREATE USER username SUPERUSER;
  1. A user can be deprived of its superuser status by removing the SUPERUSER attribute, using this command:
ALTER USER username NOSUPERUSER;
  1. A user can be restored to superuser status later, using the following command:
ALTER USER username SUPERUSER;
  1. When neither SUPERUSER nor NOSUPERUSER is given in the CREATE USER command, then the default is to create a user who is not a superuser.