The Lion update removed postgres. How to restore it?

I installed postgres with the kyngchaos installer a couple of months ago. Now I upgraded to OSX Lion, but the database server does not start.

A comment on the kyngchaos blog ( http://www.kyngchaos.com/blog/2011/20110723_lion ) made me look at the postgres user: he no longer exists! At least I canโ€™t sudo postgres anymore. Therefore, I believe that the reason why my server does not start.

How can I best restore this user?

+7
source share
4 answers

(Answering a question)

In the end, the only thing I needed to do was recreate the postgres user. I enumerated the contents of /usr/local/pgsql/ advance and saw that, for example, the data/ directory belonged to user 101 and the postgres group. So I wanted to associate this postgres user with 101 userid:

 sudo dscl . -create /Users/postgres sudo dscl . -create /Users/postgres UniqueID 101 

(And after that I restarted my Mac since I did not know how to start this postgres server manually ... ;-)

+3
source

I think in your dscl command, instead of running -create you want to do -append . Apple tends to prefix subheadings for daemon usernames. So, Apple probably created the _postgres label for user 101. By doing -create , you delete the user _postgres by default and replace him with postgres, which may cause other problems in the future. If you run -append , then you can use _postgres or postgres to refer to user 101. In any case, you must make -list before executing either -create or -append , just so that you know the land of the earth.

Note. I still use Snow Leopard, so I canโ€™t verify that user 101 is indeed _postgres , but I expect Apple to still use the same naming conventions as Leopard and Snow Leopard, and that Work. Running -list will show you what you need to know to confirm my suspicions.

+2
source

I had a similar problem, and while looking at system.log in Console, there were different permission messages in the postgresql data directory. I played with chown and other things, but in the end I just reinstalled - now everything works fine.

0
source

I didnโ€™t get the proper user after @Reinout van Rees answered Mountain Lion. These are my steps to get this working:

  • Download and install Workgroup Manger
  • Login to local ldap: {server: 127.0.01, uname: [your uname], pw: [your pw]}
  • Set View-> Show System Entries to display all accounts
  • There is no postgres check, but there is no other user with id 101 .
  • Unlock manager with lock icon
  • Create a new user {basic: {name: postgres, userid: 101, pw: None, can_admin_server: False, access_account: False}, advanced: {login_shell: / usr / bin / false}}
  • He gave some strange errors, but in the end my user created
  • Test postgres ( sudo -u postgres PGDATA=/usr/local/pgsql-9.0/data /usr/local/pgsql-9.0/bin/pg_ctl start )
  • >> Server started
0
source

All Articles