Postgres ECONNREFUSED on 127.0.0.1

Postgres fails to start properly if there's an obsolete postmaster running and services fail to connect to it so just remove the pid if it exists to make the service create a new process.

rm -f /usr/local/var/postgres/postmaster.pid

You can also subscribe to my Newsletter or RSS if you'd like to receive such posts in your inbox.