Hi,
I'm getting the message 'Could not start on Port 5432' when launching Postgres.app (it says the same from the menu bar item).
I've exhausted Google/SO, and I can't seem to fix it. From my research, I feel it may be related to the fact that I previously had pgAdmin installed on my machine.
Can anyone help with this?
pgAdmin is a PostgreSQL client and shouldn't interfere with Postgres.app
If you do have a different version of the PostgreSQL _server_ running on your Mac, that will interfere with Postgres.app. Easiest way to see if that is the problem: Jsut check in Activity Monitor, look for processes name postgres.
See http://postgresapp.com/documentation/install.html for (some) uninstall instructions.
If that's not the problem, try starting the server manually: http://postgresapp.com/documentation/troubleshooting.html
Thanks for the quick response. As you suggested, I checked in Activity Monitor, and there were some processes named postgres. So, I killed them, and sure enough Postgres.app successfully connected (I had already tried this and it didn't to fix it the first time. Not sure why).
I did then get an error an error saying the database does not exist, but createdb fixed that.
I am still having a problem though. I'm trying to get a simple Rails test app working, and after starting rails server and going to http://0.0.0.0:3000, I'm getting the following error:
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
I'm not sure if this is related though?
Thanks for your help anyway.
I've managed to fix it this now. Thanks for your help, @jakob
$ sudo pkill -u postgres
$ sudo pkill -u postgres
Thanks. It worked for me!!
$ sudo pkill -u postgres
just to explain what this does: it sends a SIGTERM signal to all processes currently running under a effective (system) user named 'postgres'.
Please be aware that there is no default user with that name on macOS nor does PostgresApp create such a user, so this is targeting a third party instance. There is the chance this one is configured to be kept alive or automatically started at boot time, so you better properly uninstall such a third party distribution if you want to get rid of it.
PostgresApp's uninstall instructions for other postgres distributions can be found here. I like to mention, while not recommended, it is perfectly possible to run multiple installations from multiple source simultaneously if you carefully manage the $PATH and ports.
Most helpful comment
$ sudo pkill -u postgres