Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
735 views
in Technique[技术] by (71.8m points)

macos - How to uninstall postgresql on my Mac (running Snow Leopard)

Upgraded 10.6 from 10.5 and now postgres 8.1 is whacked. To make things worse I tried installing 8.4 which I'm pretty sure just made things ten times worse. Anyhow, the exception I'm getting when I try to fire postgres up and just createuser is this:

createuser: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

HOW do I fully get rid of postgres on my Mac so I can do a do-over?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem was with the PostgreSQL account sitting on my machine.

I removed the account and proceeded with the uninstall using the instructions here:

Automatic Uninstall:

In the installation directory, there will be a uninstall-postgresql.app file. Executing (double clicking) that will uninstall the PostgreSQL installation.

Manual Uninstall:

  1. Stop the server:

    sudo /sbin/SystemStarter stop postgresql-8.3
    
  2. Remove menu shortcuts:

    sudo rm -rf /Applications/PostgreSQL 8.3
    
  3. Remove the ini file:

    sudo rm -rf /etc/postgres-reg.ini
    
  4. Removing Startup Items:

    sudo rm -rf /Library/StartupItems/postgresql-8.3
    
  5. Remove the data and installed files:

    sudo rm -rf /Library/PostgreSQL/8.3
    
  6. Delete the user postgres:

    sudo dscl . delete /users/postgres 
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...