I installed the PostgreSQL dmg file downloaded from here https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#macosx . On the first install it just works fine. I can use the terminal or the pgAdmin tool to see and work with databases. But it works only for a few days after installation and then the psql terminal tool gives this error psql: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?. Then I again uninstall and reinstall the software and again the same repeats. Just that you know, I downloaded version 9.6 of the DBMS and I am developing a SpringBoot app that connects to this DBMS using Hibernate. But i guess there is no problem with SpringBoot or Hibernate. They are just working fine. It has got something to do with the PostGreSQL itself.