Homebrew Postgresql role "postgres" does not exist

I’m curious whether you searched for the error (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) role "postgres" does not exist as the first result for me is a thread on this forum:

For anyone coming to this thread in future this is how I install Postgres on a new machine:

# Install with:

brew install postgresql

# Then to start Postgres and on startup, run:

brew services start postgresql@14

# Then create your initial db:

createdb

# Then:

psql
CREATE ROLE postgres LOGIN CREATEDB;

# That will create your Postgres user (use CTRL Z to exit).
1 Like