Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 609
wgpubs Avatar asked Apr 26 '10 16:04

wgpubs


People also ask

How do I completely remove PostgreSQL?

To uninstall PostgreSQL, navigate to the Windows Control Panel to open the Uninstall or change a program dialog and Right-click the PostgreSQL 13 and select Uninstall/Change from the context menu. You can either remove the entire application or individual components.

Where is PostgreSQL installed on Mac?

System: MAC OS X 10.9. 9.4) this is under the dir called /Library/PostgreSQL If you go there, open the folder named as the ver. of your PG and then go to the folder data you will find your DB.

Is PostgreSQL running Mac?

PostgreSQL can also be installed on macOS using Homebrew.


2 Answers

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  
like image 89
wgpubs Avatar answered Sep 18 '22 13:09

wgpubs


I can add this tiny command to the answer too:

rm /usr/bin/psql 

Remove executable psql alias.

like image 44
Amir Latifi Avatar answered Sep 17 '22 13:09

Amir Latifi