Add Role to PostgreSQL Server
Add role to login and create databases in your postgres server
To start using PostgreSQL, we will need a user and a database.
First, we'll switch to the postgres user account on our instance.
sudo su postgresTo run PostgresSQL, type
psqlIn the next two lines, we'll create a user role who will be able to login and create databases (3). Replace username and 'password' with your own:
CREATE ROLE username
WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'password';To stop running PostgresSQL, type
\qTo log out of the postgres account, type
exitLast updated
Was this helpful?