We are crazy about programming and we want to share our craziness with you!!!

How to uninstall Postgres on Mac?

Yesterday I wanted to run Postgres image on my mac but the docker was complaining that port 5432 is in use. I was pretty sure that I did not install Postgres on my machine, and due to the Microservice settings that I intended to run locally, I only wanted to run Postgres on port 5432, not any other port. I have searched my local machine for a copy of running Postgres and the result was negative. I reached to a good friend (Dave Oxley) with the awesome Linux background and he guided me to find the running instance of Postgres and get rid of it. Here are the steps that I took:

by looking at the result it is very clear that there is a parent processor that is running the Postgres, so technically killing PID was not helpful because it parent processor would run it again. The only option was uninstalling the Postgres, but how do I know where that Postgres was in my machine.

form the first line of log you can see that Postgres version 10 was running in my machine, so I head to that directory and uninstalled the Postgres and then I was able to run docker without any problem.