Completely Uninstall PostgreSQL 9.0.4 From Mac OSX Lion?


Answer :

The following is the un-installation for PostgreSQL 9.1 installed using the EnterpriseDB installer. You most probably have to replace folder /9.1/ with your version number. If /Library/Postgresql/ doesn't exist then you probably installed PostgreSQL with a different method like homebrew or Postgres.app.



To remove the EnterpriseDB One-Click install of PostgreSQL 9.1:




  1. Open a terminal window. Terminal is found in: Applications->Utilities->Terminal

  2. Run the uninstaller:



    sudo /Library/PostgreSQL/9.1/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh


    If you installed with the Postgres Installer, you can do:



    open /Library/PostgreSQL/9.2/uninstall-postgresql.app


    It will ask for the administrator password and run the uninstaller.


  3. Remove the PostgreSQL and data folders. The Wizard will notify you that these were not removed.



    sudo rm -rf /Library/PostgreSQL

  4. Remove the ini file:



    sudo rm /etc/postgres-reg.ini

  5. Remove the PostgreSQL user using System Preferences -> Users & Groups.




    1. Unlock the settings panel by clicking on the padlock and entering your password.

    2. Select the PostgreSQL user and click on the minus button.


  6. Restore your shared memory settings:



    sudo rm /etc/sysctl.conf



That should be all! The uninstall wizard would have removed all icons and start-up applications files so you don't have to worry about those.



homebrew Installer



Assuming you installed PostgreSQL with homebrew as referenced in check status of postgresql server Mac OS X and how to start postgresql server on mac os x: you can use the brew uninstall postgresql command.



EnterpriseDB Installer



If you used the EnterpriseDB installer then see the other answer in this thread.



The EnterpriseDB installer is what you get if you follow "download" links from the main Postgres web site. The Postgres team releases only source code, so the EnterpriseDB.com company builds installers as a courtesy to the community.



Postgres.app



You may have also used Postgres.app.



This double-clickable Mac app contains the Postgres engine.



I don't use the same version, but uninstall actions are the same:
Looking for file uninstall-postgresql inside directory



/Library/PostgreSQL/9.6


enter image description here



then run it.



enter image description here



(Screenshot in macOS 10.13)



then



sudo rm -rf /Library/PostgreSQL/


to delete all unnecessary directory.



Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable