2

Background - a few months ago, I purchased a new Macbook to replace an iMac. When I restored my data from my old iMac to the new Macbook, I accidentally used davidburton as the user when on the iMac I was burtondav.

I was then not able to run postgreSQL or Rails.

I used this symlink command to fix it:

ln -s /Users/davidburton /Users/burtondav

But, yesterday I upgraded to OS X Mavericks. Now I can't start postgreSQL or use Rails. Even after re-entering the symlink.

Is there any way to fix it???

If I have to re-install postgreSQL:

My postgreSQL files are in usr/local/var/postgres I'm pretty sure I used homebrew to install it.

How can I re-install postgreSQL without loosing my data?

I was going to dump the whole database and reload after I reinstall postgreSQL. But I can't start postgreSQL in order to dump the data.

This is what I get:

$ postgres -D /usr/local/var/postgres
2013-10-24 15:30:07 GMT <  > %FATAL:  data directory   "/usr/local/var/postgres" has wrong ownership
2013-10-24 15:30:07 GMT <  > %HINT:  The server must be started by the  user that owns the data directory.

Should I change the ownership from burtondav to davidburton?

Thanks for your help!!

Reddirt
  • 5,913
  • 9
  • 48
  • 126

1 Answers1

3

You should change the owner of the postgres data directory:

chown davidburton /user/local/var/postgres
# or
sudo chmod ugo=rwX /user/local/var/postgres # You might want to change the permissions as your needs

(You might need to use sudo)

You didn't post the error when you try to start rails/postgres, maybe this question can help you: ERROR: Failed to build gem native extension on Mavericks

Community
  • 1
  • 1
MrYoshiji
  • 54,334
  • 13
  • 124
  • 117
  • I changed the ownership. Then I got `Permissions should be u=rwx (0700)`. So, I tried `$ chmod u=rwx, g=---, o=--- postgres`. But, I got `chmod: Invalid file mode: u=rwx,` – Reddirt Oct 24 '13 at 15:57
  • Try with `sudo chmod ugo=rwX /user/local/var/postgres` – MrYoshiji Oct 24 '13 at 16:01
  • Thanks - that got postgreSQL running. Now I've got to get Rails working again. – Reddirt Oct 24 '13 at 16:10