Creating a roles and creating a db with the help of owner.

Now that our software is installed, we can go over how it works and how it may be different from similar database management systems you may have used.

Switch over to the postgres account on your server by typing:

sudo -u postgres psql

You can now access a Postgres prompt immediately by typing:

psql

Again, you can exit the interactive Postgres session by typing:

 \q

Lets Create a role and password. the user can be replaced with ur username and password with ur Password

CREATE ROLE user WITH LOGIN PASSWORD 'Getting started';

To check the roles you have created in db

\du

To create database

CREATE DATABASE sample;

To create database with the help of owner,here the owner represent the user that is created before.

CREATE DATABASE sample WITH OWNER = user;

To list all the db created

\l