- Install postgres.
- Setup password for
postgres
linux user:sudo passwd postgres
- Switch to this user:
su - postgres
- Run
psql -U postgres
- Create user with your name as in linux. Grant it some privileges. For all privileges:
CREATE USER {your_username} WITH ENCRYPTED PASSWORD '{your_password}';
ALTER USER {your_username} WITH SUPERUSER;
- Login to your linux user account and run
psql
to login as you.
P.S. the thing is that postgres allows only the linux users with the same name as postgres users to login.