Summary: in this tutorial, you will learn how to download the PostgreSQL, install PostgreSQL on macOS, and restore the sample database.
- Install Postgresql Mac Catalina Free
- Install Postgres Mac Catalina
- Install Postgresql Mac Catalina
- Install Postgresql Mac Catalina 2019
- Install Postgresql Mac Catalina Software
- Install Postgresql Mac Catalina Download
Download PostgreSQL installer for macOS
Install Postgresql Mac Catalina Free
How to install PostgreSQL 9.6 on Mac OS X (10.7 or later) PostgreSQL is an open source relational database system that has been around for well over a decade and has proven to be a great all around storage choice when developing a web application. 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. Install Postico for PostgreSQL. Postico is a user friendly interface for looking at PostgreSQL databases created locally. If you haven't installed PostgreSQL, run the following three commands before downloading Postico: brew install postgres brew services start postgresql gem install pg Protecting Your Eyes. 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. Then restart your Mac and hold the Option key until you see the Apple logo. In the Startup Disk, click the external drive name. When the boot resumes, you should boot into macOS Catalina installation wizard. At this stage, you should pick up the external SSD to install Catalina. Another way to boot Catalina is from System Preferences.
To download the PostgreSQL installer, you follow these steps:
- First, visit the PostgreSQL installer download page.
- Then, download the PostgreSQL for macOS.
Install PostgreSQL on macOS
To install PostgreSQL on macOS, you follow these steps:
First, launch the setup wizard by double-click the installer file:
Second, select the directory where the PostgreSQL will be installed and click the Next button:
Third, select the components that you want to install, uncheck the Stack Builder, and click the Next button:
Fourth, specify a directory where PostgreSQL stores the data and click the Next button:
Fifth, enter the password for the postgres user account. You should note down this password for logging in to the PostgreSQL database server later. After that, click the Next button.
Sixth, specify the port number on which the PostgreSQL server will listen. By default, PostgreSQL uses port number 5432.
Seventh, select the locale used by PostgreSQL. By default, PostgreSQL uses the locale of the current operating system:
Install Postgres Mac Catalina
Eighth, review the installation information. If everything looks correct, click the Next button to begin the installation.
Ninth, click the Next button to start installing the PostgreSQL database server on your computer:
It will take few mintues to complete the installation.
Finally, click the Finish button once the installation is completed:
Load the sample database
First, launch pgAdmin from Launchpad.
Second, enter the password for the postgres user.
Third, right-click the PostgreSQL 12 and select Create > Database.. to open a dialog for creating a new database.
Fourth, enter dvdrental as the database, postgres as the owner, and click the Save button to create the dvdrental database.
Sixth, download the sample database and unzip it. You’ll get a directory with many files.
Seventh, right-click the dvdrental database and select the Restore… menu item:
Eighth, select the directory as the Format (1), the directory that contains sample database as the Filename (2), and postgres as the Role name (3), and click the Restore button.
It will take few seconds to restore the sample database. Once the restoration completes, you will see a notification like this:
It means that you have successfully created the sample database and restored it from the downloaded file.
In this tutorial, you have learned how to download PostgreSQL installer for macOS, how to install PostgreSQL on macOS, and how to restore the sample database.
PostgreSQL is an open source relational database system that has been around for well over a decade and has proven to be a great all around storage choice when developing a web application.
In this guide we are going to walk through installing PostgreSQL 9.6 on Mac OS X (10.7 or later) so that we can eventually start using it with a Go application, but you can follow along with this guide to set up Postgres for use with pretty much anything, including Rails, Django, or Go.
Once we have Postgres setup we will also look at adding all of the executables to our path so that we can type things like psql
in the terminal in order to access Postgres. It is important to note that this step IS NOT required to use postgres, but it is nice to have so I suggest doing it.
Installation
The first thing we want to do is install PostgreSQL using Postgres.app. You can find that here: http://postgresapp.com/.
Postgres.app is about 50mb, and is by far the easiest way to setup Postgres on a Mac. It runs like any other you would download, can automatically start up with your Mac, and allows us to skip a lot of command line steps that used to be required to set up Postgres on a Mac. Yay for progress!
Install Postgresql Mac Catalina
You can grab whatever version you need at the “Other versions” section of the page, but I will be using th emost recent version which currently uses PostgreSQL 9.6.0.
Once you have unzipped the download you will want to copy the Postgres app to your Applications
folder and then open it. You might be asked if you want to open this application because it was downloaded from the internet. Click open.
You should now have Postgres running locally, and you should see a little elephant icon on the top right section of your menu bar. Click on it and then click the “Open psql” option.
If you don’t see any errors that means everything is working! Congrats!
Now lets go ahead and add Postgres to our path.
Enabling Postgres command line tools
If you are using the default terminal, you are going to want to modify the file at ~/.bash_profile
. If you are using something like Oh My Zsh you are going to want to modify the file ~/.zshrc
.
To edit this file you likely need to open it via the terminal, so open your terminal and type open ~/.bash_profile
. You can replace the word open
with subl
or whatever text editor you prefer.
Once your zbash_profile or .zshrc file is open, add the following line to the end of the file:
After that you will need to quit and restart your terminal This is to make sure it reloads with the changes you just made.
Once you have restarted your terminal, try running psql.
You should get the following output.
You have now successfully connected to Postgres using the postgres
role. This role doesn’t require a password because Postgres is only accessible locally, so it is unlikely to present any security issues.
Up Next…
Now that you have PostgreSQL 9.6 installed you are ready to start using it! Check out the next article in this series to learn how to do that - Creating PostgreSQL databases and tables with raw SQL
You can also check out an overview of the entire series, along with links to each article in the series, by going here - Using PostgreSQL with Golang.
Install Postgresql Mac Catalina 2019
This article is part of the series, Using PostgreSQL with Go.
Install Postgresql Mac Catalina Software
Learn Web Development with Go!
Sign up for my mailing list and I'll send you a FREE sample from my course - Web Development with Go. The sample includes the first few chapters from the book, and over 2.5 hours of screencasts.
Install Postgresql Mac Catalina Download
You will also receive emails from me about upcoming courses (including FREE ones), new blog posts, and course discounts.