dxw/local-env

Add postgres user

dragon-dxw opened this issue · 3 comments

Brew doesn't set up a postgres user.

Add /usr/local/opt/postgres/bin/createuser -s postgres || true to the setup script (it will fail if the user already exists)

Via: https://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-exist#comment91332745_15309551

So after doing a fresh Postgres reinstall, I needed to create a DB for my user (not postgres). I did that via createdb (no arguments).

/usr/local/opt/ is the Intel/x86 path, but I ended up doing this instead:

  • psql postgres
  • create user postgres with encrypted password 'WHATEVER_PASSWORD';
  • alter user postgres with superuser; (and a few other alterations, but I think superuser supercedes them all)