https://stackoverflow.com/questions/13410686/postgres-could-not-connect-to-server
Had a similar problem; a pid file was blocking postgres from starting up. To fix it: rm /usr/local/var/postgres/postmaster.pid and then all is well.
그리고 다시 시작
brew services restart postgresql