

Hopefully, now you can easily create user in PostgreSQL. Since you are logged in as superuser, run the \du or \du+ command to list all users in PostgreSQL. If you want to grant access to new user to your database sample_db, run the following command postgres=# grant all privileges on database sample_db to user_name Replace user_name and mypassword with new user’s username and password respectively. postgres=# create user user_name with encrypted password 'mypassword' If you want to create user in a non-interactive manner, just run the following command after Step 1 above. In this mode PostgreSQL will directly create new user without prompting you for any information. Firstly, it is important to understand that for most Unix distributions, the default Postgres user neither requires nor uses a password for authentication.
#Postgresql create database user password how to#

You can create user in interactive mode, or normal mode. Open terminal and run the following command as root user $ su - postgresīonus Read : How to Create PostgreSQL Index Here are the steps to create user in PostgreSQL. Many times you may need to create database users in PostgreSQL.
