How to fix Postgres not accepting connections issue on mac?

https://dba.stackexchange.com/questions/75214/postgresql-not-running-on-mac?newreg=77ebca4f778e4315be89738dc50b6e1a

$ brew services stop postgresql
$ rm /usr/local/var/postgres/postmaster.pid # adjust path accordingly to your install
$ brew services start postgresql