sudo -u postgres psql
\q
\du
Note: This command will return list of the users.
CREATE USER username WITH PASSWORD 'YourPassword';
Note: Replace username
with your database user, and password with your password
.
\l
Note: This command will return the list of databases.
CREATE DATABASE db_name OWNER username;
Note: Replace db_name
with your project database name and username
with your dabatase user.
GRANT ALL PRIVILEGES ON DATABASE db_name TO username;
Note: Replace db_name
with your project database name and username
with your database user.
ALTER DATABASE db_name OWNER TO username;
\c database_name;
Note: This will enter in your database;
\dt
Note: This command will return the list of table under the database.