Install/Uninstall PostgreSQL on a Mac

Use the installer from Enterprise DB website to install on a mac. There are installers available from BigSQL but they aren’t quite standard so uninstallation could be a little more work. Here are instructions to install and uninstall PostgreSQL on/from your Mac.

Install postgres
1. Download the installer from the following link and click through the installation process

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#macosx

2. Follow instructions to execute psql from commandline on Mac:

https://varunver.wordpress.com/2016/09/26/executing-psql-from-command-prompt-on-mac-osx-after-installing-postgresql/

Uninstall process
1. If you used the above link to install postgres on your system, it would have been installed under /Library/PostgreSQL. Navigate to the following directory from your terminal as root (The version 9.6 may differ based on the version that was installed on your system):

cd /Library/PostgreSQL/9.6/

2. Open the uninstaller and follow instructions to remove the application

open uninstall-postgresql.app

3. Remove the PostgreSQL and data folders. The Wizard will notify you that these were not removed.

rm -rf /Library/PostgreSQL

4. Remove the configuration file that keeps track of the database version you are using:

rm /etc/postgres-reg.ini

5. Remove the PostgreSQL user using System Preferences -> Users & Groups.

That should be all! The uninstall wizard would have removed all icons and start-up applications files so you don’t have to worry about those.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s