1.install psql
sudo apt install postgresql postgresql-contrib;
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
标签:psql,superuser,sam,sudo,user,login From: https://www.cnblogs.com/Fred1987/p/17827714.html