7

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.

2 Answers 2

7

postgres user

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: System Preferences > 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.

Backup/Export

Of course, first backup your database with a tool like pgBackup. And/or export your data.

Uninstaller app

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).

/Library/PostgreSQL/10

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.

/Library/PostgreSQL/10/data

screen shot of the Finder with Postgres data folder selected

data folder

Select that data folder in the Finder, and choose File > Move to trash. When prompted, provide your own macOS user account password.

Delete that outer Postgres folder(s) that contained data.

Applications folder

Remove the PostgreSQL 10 folder in your Applications folder if it remains. Again, provide your own macOS user account password.

screen shot of the Finder showing "PostgreSQL 10" folder in Applications folder

1
  • If it helps anyone, I found the uninstall.app in /Users/vignesh/PostgreSQL/uninstall folder. Oct 9, 2018 at 12:30
3

As an addendum to the current accepted answer:

To remove the Postgres user:

  • Go to System Preferences -> Users & Groups
  • Click the lock icon on the bottom left corner and enter your password
  • Select the Postgres user and click the minus button, confirm in the dialog

Tested on Siera 10.12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.