I just installed postgresql on a Macbook with brew install postgresql. Then I try to psql, but it requires password and then show
The answer by Pramida almost worked for me... the difference is I was using 9.6 Postgres.
So I ran:
sudo /Library/PostgreSQL/9.6/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh
and somehow that got rid of my username and almost all of postgres user. I think
I then blew away the directory
sudo rm -rf /Library/PostgreSQL/9.6
And then I installed using brew above.