- Create the missing postgres role
createuser -s postgresHomebrew's PostgreSQL only creates a role named after your Mac user.
Check it worked
- Connect as postgres
psql -U postgres -c "SELECT current_user;"
- Create a role for your Linux userNeeds sudo
sudo -u postgres createuser --superuser $USER - And a database with the same name (psql looks for it)
createdb $USER
Check it worked
- Connect as yourself
psql -c "SELECT current_user;"
- Connect as the postgres user instead
psql -U postgresOn Windows, psql tries your Windows user name unless you say otherwise.