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 having issues installing postgresql with homebrew on my MBP running OS 10.6.8.

It finishes

sudo brew install postgresql

without any issues.

When I try:

initdb /usr/local/var/postgres

I get the following error:

This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

fixing permissions on existing directory /usr/local/var/postgres ... initdb: could not change permissions of directory "/usr/local/var/postgres": Operation not permitted

But when I try to run

  mkdir -p ~/Library/LaunchAgents
  cp /usr/local/Cellar/postgresql/9.1.1/org.postgresql.postgres.plist ~/Library/LaunchAgents/
  launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist

I get the following error:

launchctl: CFURLWriteDataAndPropertiesToResource(/var/db/launchd.db/com.apple.launchd.peruser.501/overrides.plist) failed: -10

I don't understand how to fix this.

So I was a little impatient and then tried to startup postgres manually anyway and it wouldn't work.

Anyway, I don't know how to proceed. Any suggestions?

share|improve this question

migrated from stackoverflow.com Dec 9 '11 at 1:09

This question came from our site for professional and enthusiast programmers.

    
First thing would be to check with whomever is maintaining the brew script for postgres. Also, check the permissions of the /usr/local/var/postgres directory. Sounds like maybe root owns the dir and whatever user the postgres daemon tries to start as isn't root... –  Peter Loron Dec 8 '11 at 4:37
    
I just checked that out. The directory is owned by Wheel. I'm the only user on my machine and I have root access. Thanks for helping my brainstorm. –  Cyrus Dec 8 '11 at 4:53
add comment

1 Answer 1

From the installation document: You don’t need sudo when you brew install.

Uninstall the sudo copy of postgres and reinstall without sudo.

sudo brew uninstall postgresql
brew install postgresql
share|improve this answer
add comment

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.