PostgreSQL icon

PostgreSQL is not typically problematic, but if you get some issues with it, it is recommended to reinstall the program instead of trying to fix the problem. So in this article, we are going to explain how to uninstall PostgreSQL on a Mac easily and quickly.

Contents:

  1. How to remove PostgreSQL using Terminal.
  2. How to remove PostgreSQL using App Cleaner.

How to remove PostgreSQL using terminal

First, you should stop Postgres server on your Mac. For this, click on the Elephant icon in the toolbar and select Shutdown server.

uninstall pgadmin 4 mac

If you installed Postgres with its Installer, then you can use the Terminal command line to remove Postgres. For this, go to the Applications folder →Utilities → open Terminal → and run the uninstaller using the following command:

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

Or try this one

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

If you encounter the message that this file does not exist, then skip to Method 2 of PostgreSQL removal. If the command runs the uninstaller, proceed to the next steps.

uninstall postgres

Enter the administrator password to launch the uninstaller. Then follow the provided steps to remove the PostgreSQL and data folders.

Unfortunately, the root uninstaller doesn’t delete all service files of the program, so you will need to remove them manually. For this, use the commands below:

  1. Remove the ini file:
    sudo rm /etc/postgres-reg.ini
  2. Remove the PostgreSQL folder from the system Library:
    sudo rm -rf /Library/PostgreSQL
  3. Remove the PostgreSQL user. Go to System Preferences → Users & Groups → click the Lock icon and enter the administrator password to unlock settings → select the PostgreSQL and click the “-” icon.  remove postgresql mac
  4. Restore your shared memory settings using this command: sudo rm /etc/sysctl.conf

That’s all with the first method of removal. Now, let’s learn the second method, which you will most likely find easier and more convenient.


How to remove PostgreSQL using
App Cleaner & Uninstaller

App Cleaner & Uninstaller is a removal tool for any kind of program on Mac. With this uninstaller, you can uninstall PostgreSQL well. Here are a few steps to do that:

  1. Download App Cleaner & Uninstaller and launch it.
  2. Confirm access to your Applications folder and it will start scanning it to find the installed apps on your Mac. Then you will see a list of apps in the left section. Find and select the PostgreSQL folder. In the right section, you can preview all executable files, support files, cache and all types of file related to PostgreSQL. remove postgres mac
  3. Click the Remove button and confirm the removal of the selected files. uninstall postgres mac

Note that App Cleaner & Uninstaller automatically detects all the support files of the apps, so you don’t need to search for and remove them manually. If you already deleted PostgreSQL in the regular way, you can find the leftovers of the program in the Remaining Files tab.

how to uninstall postgresql on mac
That’s all. As we promised, easy and fast!


Articles you may be interested in: