Install Postgresql Mac Catalina

Software

How-to Uninstall PostgreSQL 13.3 and Reinstall via Brew

  1. Install PostgreSQL using Homebrew. In Terminal run the following command to install PostgreSQL on Mac using Homebrew. $ brew install postgres. We can check the version of PostgreSQL using the psql command. $ psql -version psql (PostgreSQL) 11.5.
  2. When you have a compatible Mac and the macOS Catalina download completes, but there’s no prompt for the installation to continue, then search in your Mac’s application folder for a file called.
Postgresql

Continuing my local install of software using Homebrew on MacOS 10.15. A work in progress! The Catalina install files will start to download. The installer file will be multiple GB. Big Sur is 12.6GB, for example, so expect downloading to take a while. If you have an M1 Mac here's. Homebrew is a package manager for Mac OS X that builds software from its source code. It includes a version of PostgreSQL packaged by what it refers to as a formula. This type of installation might be preferred by people who are comfortable using the command line to install programs, such as software developers.

Step-by-step guide on removing PostgresSQL installed via installer and re-installing it via brew for macOS Catalina

Who is this for?

For anyone who needs to completely uninstall PostgresSQL 13.3, which was installed via the installer.

This article will cover three topics:

  • How to uninstall PostgreSQL 13.3
  • How to reinstall PostgreSQL back via brew
  • Test to see if it’s working: create database, user, and grant privileges
  1. How to uninstall PostgresSQL 13.3

Step 1: Open your terminal. Check installed version as well as location. In my case, it is installed under /Library/PostgreSQL/13/bin/psql

Step 2: Depending on whether the uninstall-postgres.app is installed, we have two solutions.

Solution 2A:

Change the directory to run uninstall-postgres.app This app is located upper directory of the bin folder, which in my case it is /Library/PostgreSQL/13 .

If the Uninstallation window prompt, you can follow this guide on section [Uninstalling PostgreSQL on Mac].

However, this solution didn’t work for me. I received an error message:

After trying many other methods online, though none seemed to lead to fruition, I noticed an interesting pattern, that is → for the same function, some people would say the typepostgres , and other people would suggest typepostgresql . Out of desperation, I accidentally discovered solution 2B.

Solution 2B:

Just change $ open uninstall-postgres.app to $ open uninstall-postgresql.app . It’s such a small change but it worked! 🤩

Postgresql

The uninstallation window prompted! If this works for you too, you can follow this guide on section [Uninstalling PostgreSQL on Mac] until Fig 8.

Important note: after you followed the above guide, all the way until Fig 8, we are not done yet! In order to remove all the Postgres related files, you need step 3.

Step 3: remove postgres related files

🎉🎉🎉 Hooray! We successfully uninstalled PostgreSQL 13.3!!

Install

2. How to reinstall PostgreSQL back via brew 🍺

The reason I need to uninstall PostgreSQL is that I couldn’t use the same code my coworker was using when I need to create a test database. And we suspect that there’s a difference between PostgreSQL installed via installer and PostgreSQL installed via brew. Long story short, it is true at least in my case, it solved the problem.

Install Postgresql Mac Catalina Software

Install PostgreSQL back via brew is very simple, it has two steps:

By this point, we can launch postgresql by running below command.

After running that, it tells us we successfully started postgresql

Now, let’s test to see if it’s working.

3. Test: perform three tasks — create a database, user, and grant privileges.

Install postgresql mac catalina free

Step 1: launch postgres

you can use command l to see all the databases available. For example, this is what I can see.

Step 2: I created a database called discovery_db , you can name the database that suits your purpose.

Now we have 4 rows and discovery_db is listed on the top. Neat!

Step 3: Create a user with a password.

Step 4: Grant all privileges to the user we just created.

Now, let’s check again →

In the output Access privileges , we can see discovery_db_users has the same privileges as the owner wen (me 😊).

Install Postgresql Mac Catalina

Finally, we can exit postgres qwith content.

Install Postgresql Mac Catalina 2019

Key Takeaways:

Install Postgresql Mac Catalina Free

  1. If you run into Postgres issues and the blog post you found online don’t seem to work for you, try to modify the commands postgres to postgresql or vice versa.
  2. There are many different versions of Postgres. If you can’t run other people’s code, it might be easier to uninstall Postgres completely and reinstall instead of debugging for days.
  3. I realized this post might be outdated once there’s a new version of Postgres, but I thought it would at least serve as a time-shot solution for PostgreSQL 13.3 + MacOS Catalina system.

Install Postgres Mac Catalina

How-to uninstall PostgreSQL 13.3 and reinstall via brew was originally published in Towards Data Science on Medium, where people are continuing the conversation by highlighting and responding to this story.