EVAnaRkISTO at
I don't remember having used postgres ever and I forget everything I ever knew about IT very fast but here go two (maybe silly) ideas: I assume you have checked postgres server logs for errors, so the one I can add is to check if socket file is locked by any other process.
I just remembered another test: Try to telnet/SSH to the IP:Port of postgres server and check if something helpful info comes out.