Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use Postgres on a Mac. After changing the location of the data folder, postgres didnt start. It doesnt give any error message.

I've copied the data folder from another location, and I've tried running

./pg_ctl -D location -l logfile start

from the directory where pg_ctl is located. It gives the message Server Started, but when i check using ps -ef | grep postgres, no PID is returned. I wonder if on MacOS X, it's necessary to run initdb again on a Mac - in Windows we can easily change the data folder and it works in any location. Please help me.

share|improve this question
The error messages should be in logfile. What's in it? – Daniel Vérité Mar 20 '13 at 14:01
Hi Thanks for the Reply.. I checked the logfile and it is giving error "data folder has wrong Ownership" – Durgesh Mar 25 '13 at 7:32

Based on the error message "data folder has wrong ownership", the problem is that the copy was made in a way that doesn't retain ownership and permissions.

To avoid that, you may use cp -rp command in a Terminal window to copy the data folder, if you still have it:

cp -rp /path/to/old-data /path/to/new-data

If the old data directory is lost, the ownership in the new one could be fixed with:

  chown -R postgres /path/to/new-data

You may also need to ensure proper permissions with:

  chmod -R go-rwx /path/to/new-data
share|improve this answer
Thanks Daniel...information was really usefull – Durgesh Apr 2 '13 at 5:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.