Completely uninstall PostgreSQL 9.0.4 from Mac OSX Lion?

前端 未结 9 978
难免孤独
难免孤独 2020-11-27 08:53

This question may look like a duplicate of: How to uninstall postgresql on my Mac (running Snow Leopard) however, there are two major differences. I\'m running Lion and I\'m

相关标签:
9条回答
  • 2020-11-27 09:21

    Uninstallation :

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

    Removing the data file :

    sudo rm -rf /Library/PostgreSQL
    

    Removing the configs :

    sudo rm /etc/postgres-reg.ini
    

    And thats it.

    0 讨论(0)
  • 2020-11-27 09:21

    Incase you have multiple versions of Postgres installed on your machine. You can remove all via brew command as:

    brew uninstall --force postgresql
    
    0 讨论(0)
  • 2020-11-27 09:27

    If you installed using the graphical installer by BigSQL from the official postgres site and if you installed in the default location...

    You can find your uninstaller in your home directory: /Users/<yourusername/PostGreSQL/uninstall/

    0 讨论(0)
  • 2020-11-27 09:33

    open terminal and type the below command and hit enter

    sudo /Library/PostgreSQL/9.X/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh
    
    0 讨论(0)
  • 2020-11-27 09:34

    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.

    0 讨论(0)
  • 2020-11-27 09:34

    This blog post explains very well:

    (just replace 9.X by your version. e.g: 9.6)

    A. If installed PostgreSQL with homebrew, enter brew uninstall postgresql

    B. If you used the EnterpriseDB installer, follow the following step.

    Run the uninstaller on terminal window: sudo /Library/PostgreSQL/9.X/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh

    C. If installed with Postgres Installer, do:

    open /Library/PostgreSQL/9.X/uninstall-postgresql.app

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

    sudo rm -rf /Library/PostgreSQL
    

    Remove the ini file:

    sudo rm /etc/postgres-reg.ini
    

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

    Unlock the settings panel by clicking on the padlock and entering your password. Select the PostgreSQL user and click on the minus button. Restore your shared memory settings: sudo rm /etc/sysctl.conf

    0 讨论(0)
提交回复
热议问题