These steps are to remove the One-Click install of PostgreSQL 9.1 (not the homebrew editions). This can be ascertained if you find the /Library/PostgreSQL directory.
- Open a terminal window. Terminal is found in: Applications->Utilities->Terminal
- Run the uninstaller. Both methods will ask for the administrator password to run the uninstaller.
If you installed with the Postgres Installer, you can do:open /Library/PostgreSQL/9.2/uninstall-postgresql.app
OR force uninstall using:
sudo /Library/PostgreSQL/9.1/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh
- Remove the PostgreSQL and data folders. The Wizard will notify you that these were not removed.
sudo rm -rf /Library/PostgreSQL
- Remove the ini file:
sudo rm /etc/postgres-reg.ini
- Remove the PostgreSQL user using System Preferences -> Users & Groups
- Unlock the settings panel by clicking on the padlock and entering your password.
- Select the PostgreSQL user and click on the minus button.
- Restore your shared memory settings:
sudo rm /etc/sysctl.conf
The uninstall wizard would have removed all icons and start-up applications files so you don’t have to worry about those.