Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.