How to uninstall PostgreSQL on Mac

Asya Karapetyan
Content marketer, who specializes in Mac how-to guides
April 29, 2024
7 minutes to read

PostgreSQL is not typically problematic, but if you are experiencing some issues with it, it is recommended to reinstall the application instead of trying to fix the problem. Thus, here we are going to explain how to uninstall PostgreSQL from a Mac computer easily and quickly. This guide is checked for macOS Sonoma and all earlier versions of macOS.

removing PostgreSQL

Contents:

  1. Should I remove PostgreSQL?
  2. How to remove PostgreSQL using Terminal.
  3. The easiest way to remove PostgreSQL from Mac.

#1 Tip: A quick way to completely uninstall PostgreSQL on Mac

If you do not have time to explore what macOS catalog system is, but you need to quickly uninstall PostgreSQL with all its system files and folders, switch to the automatic removal method and uninstall the application using App Cleaner & Uninstaller tool.
This is a special progra that will help you to completely uninstall any application from Mac along with their caches, logs, login items, preferences and browser extensions.
“App

App Cleaner & Uninstaller

Free Download


Before we start, watch a short video how to uninstall PostgreSQL on Mac.

Should I remove PostgreSQL?

PostgreSQL is a powerful open source database system that leverages and extends the SQL language, combined with a host of features to securely store and scale the most complex data workloads. PostgreSQL has tons of various features designed to help developers build applications, administrators protect data integrity and create resilient environments, and help manage data regardless of dataset size.
However, PostgreSQL is likely taking up 108GB of space on your computer because of the data it’s storing, including databases, logs, and other related files. If you’re not actively using PostgreSQL and you need the space, you can uninstall it from your computer. Just make sure to back up any important data stored in PostgreSQL before uninstalling it, and follow the uninstallation steps below to avoid any potential issues.

How to remove PostgreSQL using Terminal

Deleting PostgreSQL just by dragging-and-dropping it into the Trash is not the correct way to uninstall apps. In this case, all the Postgre system service files will remain on your computer and keep cluttering up your disk space. Meaning, they will not let you correctly reinstall the software in the future.

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

.

drop menu - Shutdown server selected

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, open Utilities subfolder, and launch Terminal. After that 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 get the message that this file does not exist, then skip to the second PostgreSQL removal way. If the command runs the uninstaller, proceed to the next steps.
Terminal window showing a command for uninstalling PostgreSQL
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 PostgreSQL files, 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 account. 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. System Preferences window - users and groups - PostgreSQL user name
  4. Restore your shared memory settings using this command: sudo rm /etc/sysctl.conf

That’s all with the first method of removal. If for some reason this method does not work for you or you simply do not want to waste your time we recommend to completely uninstall PostgreSQL with the App Cleaner & Uninstaller tool, which will automatically find all support files of PostgreSQL and remove the application entirely. Keep reading this article to find out more about this tool.


The easiest way to remove PostgreSQL from Mac

Uninstalling PostgreSQL with Terminal may be a really time-consuming process. Moreover, you might have missed some service files and left them on your Mac’s hard drive. That’s why we recommend that you uninstall PostgreSQL automatically.

For the automatic uninstallation method, you need to use a special free cleanup application – App Cleaner & Uninstaller. This software automatically gathers all the service files of each application and allows you to uninstall them with one click. With this software tool, you can uninstall PostgreSQL without any extra steps and it will not take much of your time. Here are a few steps to do that:

  1. Download App Cleaner & Uninstaller and launch it.
  2. It will start scanning your Applications folder and show you the list of all installed apps on your Mac.
  3. Locate and select the PostgreSQL.
  4. If you switch on the Expert mode, you’ll see all the PostgreSQL client support files, like caches, preferences, etc. 
  5. Click the Remove button and confirm the removal of PostgreSQL on a Mac.
  6. App Cleaner & Uninstaller window showing postgreSQL

Note that the app uninstaller automatically detects all the support files of the apps, so you don’t need to waste your time searching and removing them manually. That is why if you have already deleted PostgreSQL in a regular way, just by dragging-and-dropping it into the Trash, we recommend you to switch to the Remaining Files tab. That section will display all the leftovers of previously incorrectly deleted applications. So that is the perfect option to quickly get some free space.
Terminal window - uninstalling postgresQL command


Conclusion

In this article, we provided you with two ways of uninstalling PostgreSQL from Mac. You can uninstall it manually using the Terminal, which is a time-consuming task or you can follow the instruction of automatic uninstallation. Nektony recommends using a professional App Cleaner & Uninstaller tool. This application was developed specially for fast, safe, and complete uninstallation of any no longer needed application.



FAQs

Where is Postgres installed by default on Mac?
How do I know if PostgreSQL is running on my Mac?
How do I update Postgres on my Mac?
Scroll to Top