Postgresql:could not connect to server: Connection refused Is the server running on host “lo
On windows, Just go to the 'Services'. Start/Restart the postgresql-X64 service. It worked for me as my service was in a stopped state somehow.