I installed postgresql-9.1 a while back, while trying to learn Rails. I didn't have any trouble with it at the time, but I just opened my Console.app to troubleshoot something else and I see the following errors repeating every 10 seconds:
3/1/13 10:28:15 AM com.edb.launchd.postgresql-9.1[89003] 2013-03-01 15:28:15 GMT FATAL: data directory "/Library/PostgreSQL/9.1/data" has wrong ownership
3/1/13 10:28:15 AM com.edb.launchd.postgresql-9.1[89003] 2013-03-01 15:28:15 GMT HINT: The server must be started by the user that owns the data directory.
3/1/13 10:28:15 AM com.apple.launchd[1] (com.edb.launchd.postgresql-9.1[89003]) Exited with exit code: 1
3/1/13 10:28:15 AM com.apple.launchd[1] (com.edb.launchd.postgresql-9.1) Throttling respawn: Will start in 10 seconds
How can I stop it?
Looks like you have EnterpriseDB's PostgreSQL package installed, but you mustn't be using it since the server can't start. I presume you're using some other PostgreSQL server like Postgres.app or Homebrew Postgres for your dev work?
If so, consider just uninstalling the unused EnterpriseDB PostgreSQL package. Alternately, you could remove its launchd config file so launchd didn't try to start it, but that might create more confusion later.
If you want to use it, you need to fix the permissions. "The user that starts the server" won't be your username, it'll be a user named postgres or postgres_ (on some Mac systems). You can find out which by reading the launchd file for EDB PostgreSQL. Then you need to:
sudo chown -R postgres /Library/PostgreSQL/9.1/data
(or postgres_ depending on what launchd expects).
If you're running another PostgreSQL server this will likely allow the EDB server to attempt to start, but it'll conflict with the port number used by your other PostgreSQL so it'll still fail. Or it might start up successfully next time your computer starts and you won't be able to access your other PostgreSQL instance anymore. So if you're using another version of PostgreSQL already, you should probably just uninstall this one.
I had the same issue when I updated my PostgreSQL with the homebrew to 9.3 version. I started to search the solving the problem in the internet but unfortunately it wasn't successfully. So I decided to research the problem by myself. I found that the postgres was tried to start from 2 places: /System/Library/LaunchDaemons/ and the ~/Library/LaunchAgents. Just remove old one or disable it (which is placed in the /System/Library/LaunchDaemons/) and that's it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With