Error Message
could not connect to server: Connection refused
Is the server running locally and accepting
connections on socket "/tmp/.s.VTPORT.5433"?
Explanation
A stale socket exists in /tmp. This usually happens when the db is not shut down normally.
Workaround
Remove /tmp/.s.VTPORT.5433*
and restart the database.