Title says it all… How to completely remove a Postgres cluster from a macOS computer?
I used the installer app provided by EnterpriseDB as a courtesy to the community.
This uninstallation question has been asked multiple times on Stack Overflow. But those questions and answers are years out-of-date.
The user account named
postgres (by default) created by the installer is actually a macOS user account.
- Apple allows deleting a user account in the more recent versions of macOS:
Users & Groups>
-button in list, after authenticating with padlock icon in lower corner.
- In older macOS versions that do not delete user accounts, you may be able to hide that user account.
Every other trace of Postgres can be removed.
Of course, first backup your database with a tool like pgBackup. And/or export your data.
The installer app provided by EnterpriseDB does install an app named
Uninstaller. Find it in the Postgres folder, probably located at the root
Library folder (not the
Library folder in your home folder).
Run that uninstaller app, and supply your macOS system password. After the run, the data folder remains as that is owned by the
postgres user rather than your regular macOS user. The uninstaller app reminds you of this fact.
data folder in the Finder, and choose
Move to trash. When prompted, provide your own macOS user account password.
Delete that outer Postgres folder(s) that contained
PostgreSQL 10 folder in your
Applications folder if it remains. Again, provide your own macOS user account password.
As an addendum to the current accepted answer:
To remove the
- Go to System Preferences -> Users & Groups
- Click the lock icon on the bottom left corner and enter your password
- Select the
Postgresuser and click the minus button, confirm in the dialog
Tested on Siera 10.12