Install Postgresql Mac Catalina

How-to Uninstall PostgreSQL 13.3 and Reinstall via Brew

  1. Install Postgresql Mac Catalina Free
  2. Install Postgresql Mac Catalina
  3. Install Postgresql Mac Catalina Download
  4. Install Postgresql Mac Catalina 2019
  5. Install Postgresql Mac Catalina Software
  6. Install Postgres Mac Catalina
Install Postgresql Mac Catalina

My previous post How I setup my Mac for development will work just fine with older macOS. I also made a video, check it out if you have trouble installing ruby, python, nodejs. But now that it's Catalina, bash has been changed to zsh and I want to note my setup and other findings here. Most of the steps are the same except nvmrc part. Having recently started afresh on macOS, I thought I’d make some notes on setting up a new dev environment. In this post we’ll set up a fresh dev environment for Ruby and Elixir – but you can use this guide for any similar web development set-up since the version manager we’ll be using can be used for lots and lots and lots of different languages. I recently upgraded to macOS Catalina and needed to reinstall PostgreSQL via Homebrew. The usual process is simple enough: brew install postgresql does the bulk of the work, and then running brew services start postgres would normally result in Homebrew’s service manager loading the appropriate launch agent for you.

Install Postgresql Mac Catalina Free

  1. I have a problem with connecting to postgresql on mac os catalina. I had postgresql installed, but I deleted it with the uninstall file (library postgresql uninstall). The file is gone and I also deleted the postgresql user from the system. I want to do a fresh (re)install of postgresql. I did the following: brew update brew doctor brew.
  2. Continuing my local install of software using Homebrew on MacOS 10.15. A work in progress!

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

Who is this for?

Mac

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

Install Postgresql Mac Catalina

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! 🤩

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

Install

Install Postgresql Mac Catalina Download

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

Catalina

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

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

Install Postgresql Mac Catalina 2019

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

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

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 →

Install postgresql mac catalina

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

Finally, we can exit postgres qwith content.

Install Postgresql Mac Catalina Software

Key Takeaways:

Install Postgres Mac Catalina

  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.

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.