postgresqlmacossudomacos-high-sierra

PostgreSQL: Can't log into Postgres - sudo broken?


Hey so after I ran into somes issues I decided to uninstall Postgres and re-install it (re install a newer version btw).

I'm trying to access postgres to create a new db for my Rails app so I run su postgresor su _postgres then I am asked a password but nothing that I enter works.

So I tried sudo -u postgres psql and got

sudo: unknown user: postgres
sudo: unable to initialize policy plugin

I tried also to disable SIP (see: here)

but it didn't work either. same results.

I don't know what to do. Any idea ? I am using Mac OS High Sierra 10.13.6.


Solution

  • Thanks to @gordon Davidson and @wildplasser 's help, I found the solution:

    sudo -u myusername psql postgres