Homebrew postgres broken

前端 未结 8 1702
野趣味
野趣味 2020-12-07 08:49

I installed Postgresql 9.4.0 installed on my Mac (10.10.1/Yosemite) using homebrew. It does not work.

I have created the softlink to /usr/local/opt/postgresql/homebr

8条回答
  •  独厮守ぢ
    2020-12-07 09:47

    Please note that their is a thread on Homebrew's github dealing with this issue: https://github.com/Homebrew/homebrew/issues/35240


    I have had a similar issue. James answer helped me solve it. But I then ran into the issue jbk is mentioning (after having deleted /usr/local/var/postgres, it kept on being recreated).

    The issue is that if you have created the symlink:

    ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
    

    and launched the process:

    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    

    you should first unload it:

    launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    

    before running James's commands.

    rm -rf /usr/local/var/postgres  # in case this is not your first try
    mkdir /usr/local/var/postgres
    chmod 0700 /usr/local/var/postgres
    

    In addition, if, like me, you have an admin user managing homebrew and a regular user who will be using pgsl for development purpose, James command should be run as super user:

    sudo -s
    

    and ownership over the postgres directory should be given to your dev user:

    chown my-dev-user /usr/local/var/postgres
    

    The following command, run as the dev user, should then properly populate the directory:

    createdb `whoami`
    

    Running:

    psql -l
    

    should show you the tables and user permissions in postgre after such manipulations.

    Hope this helps.

提交回复
热议问题