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.
Contents:
- Should I remove PostgreSQL?
- How to remove PostgreSQL using Terminal.
- The easiest way to remove PostgreSQL from Mac.
#1 Tip: A quick way to completely uninstall PostgreSQL on Mac
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 Cleaner & Uninstaller
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
.
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.
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:
- Remove the ini file:
sudo rm /etc/postgres-reg.ini - Remove the PostgreSQL folder from the system Library:
sudo rm -rf /Library/PostgreSQL - 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.
- 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:
- Download App Cleaner & Uninstaller and launch it.
- It will start scanning your Applications folder and show you the list of all installed apps on your Mac.
- Locate and select the PostgreSQL.
- If you switch on the Expert mode, you’ll see all the PostgreSQL client support files, like caches, preferences, etc.
- Click the Remove button and confirm the removal of PostgreSQL on a Mac.
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.
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?
Postgres is typically installed in the following directory on Mac:
/usr/local/pgsql
If you can’t find it there, use the following command in the Terminal to find out where Postgres is installed on your Mac:
brew info postgres
This will show you more information about the Postgres package installed by Homebrew, including the location of the data directory and the configuration files.
How do I know if PostgreSQL is running on my Mac?
To check PostgreSQL running processes, use the following command:
ps auxwww | grep postgres
How do I update Postgres on my Mac?
Follow these steps to update PostgreSQL on macOS:
- Uninstall the hold version of Postgres using the guide above.
- Download the new version of Postgres.app and double-click the downloaded .dmg.
- Follow the eon-screen instruction to install the app.