after updating my Mac to the latest OS-Version (Ventura 13.0.1), the following error appears after running mix phx.server:
[error] Postgrex.Protocol (#PID<0.405.0>) failed to connect: ** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) role "postgres" does not exist
It worked fine the day before and literally no changes were made
After running psql -l I can sear the user “postgres”.
First, how do you installed PostgreSQL ?
In the case you installed it with brew, install or update xcode-command-line utilites, and reinstall PostgreSQL, this might help
In case it is useful to capture this here, we run postgres in docker on our dev machines (both for mix test and for running our application locally), and here are the commands we use to rebuild it:
Best if you can reinstall Postgres in-situ; macOS upgrades are known to wreak havoc with third party software. Once reinstalled, you can verify that the system works and the role exists via psql.
fwiw I’ve been using https://postgresapp.com for pretty much a decade - same install - multiple upgrades (both OS and postgres(app)) - never any issue… so highly recommended…