Fill these in once
Peer authentication is a Linux setting. On macOS, see Fix PostgreSQL role does not exist.
- Option 1: run psql as the matching Linux userNeeds sudo
sudo -u postgres psql - Option 2: connect over localhost with a password
psql -h localhost -U postgres -d postgresAdding -h localhost switches from peer checks to a password. Set one with Change a PostgreSQL user's password if needed.
- Option 3: find the settings file to change the rule for goodNeeds sudo
sudo -u postgres psql -c "SHOW hba_file;"In that file, change peer to scram-sha-256 on the local line, then run sudo systemctl reload postgresql.
Peer authentication is a Linux setting. On Windows, connect with psql -U postgres.