psql
1.install psql
sudo apt install postgresql postgresql-contrib;
sudo apt-get install postgresql-client;
2.login as the default user postgres
sudo -u postgres psql;
3.create user as superuser with password
create user sam superuser login password 'Sam0001!';
4.show all users;
\du;
5.login pgsql with sam
sudo psql -h localhost -p 5432 -Usam -dpostgres
6.grant all privileges to user in default user postgres
sudo -u postgres psql; \du; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO sam; \du;