Install PostgreSQL 14.7 for MacOS – Dataquest (2023)

In this tutorial, you'll learn how to install PostgreSQL 14.7 on your MacBook using Homebrew, a popular package manager for macOS.
The process is straightforward and consists of the following steps:

  1. Install Homebrew
  2. Install PostgreSQL
  3. Download the Northwind PostgreSQL SQL file
  4. Create a New PostgreSQL Database
  5. Import the Northwind SQL file
  6. Verify the Northwind database installation
  7. Connecting to the Database Using Jupyter Notebook


You'll need a MacBook or iMac running macOS 10.13 or later to follow this tutorial.

Install Xcode Command Line Tools
First, you need to install the Xcode Command Line Tools, which provide essential tools for building software on your Mac.

  1. Open the Terminal app (you can find it in Applications > Utilities) and enter the following command:

    xcode-select --install

    A pop-up window will appear, prompting you to install the Command Line Tools. Click on "Install" to proceed. Once the installation is complete, you can move on to the next step.

Step 1: Install Homebrew

With the Xcode Command Line Tools installed, you can now install Homebrew itself. Homebrew is a package manager for macOS that will make it easier for us to install PostgreSQL and manage other software packages.

After installing Homebrew, it's important to add it to your system's PATH. By doing this, we're telling the system where to find the Homebrew executables. This means you can run Homebrew commands directly from any location in your Terminal.

We will then verify the successful installation of Homebrew using the version check command. This crucial step confirms that Homebrew has been correctly installed and is accessible via your Terminal.

Now, let's get started with the installation of Homebrew and its addition to your system's PATH.

  1. Copy and paste the following command into the Terminal app. The script will automatically download and install Homebrew on your Mac. You might be prompted to enter your admin password during the installation process. After the installation is complete, you will see a message saying, "Installation successful!"

    /bin/bash -c "$(curl -fsSL <>)"

  2. The next step is adding Homebrew to your PATH. Follow the steps below to complete the Homebrew installation:

    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/user_name/.zprofile

    This command appends the necessary line to your .zprofile file to load Homebrew into your PATH. Replace /Users/user_name with your actual user directory.

  3. Now, run the second command:

    eval "$(/opt/homebrew/bin/brew shellenv)"

    This command loads the Homebrew environment variables into your current Terminal session.

  4. To verify your Homebrew installation, run the following command:

    brew --version

    This should display the Homebrew version number, confirming that it's installed and available in your PATH.

Step 2: Install PostgreSQL

In this step, we will utilize Homebrew to set up PostgreSQL on your macOS system. The steps will guide you through updating Homebrew to guarantee that we're accessing the latest software packages. Next, we'll install PostgreSQL version 14 using a single Homebrew command, and start the PostgreSQL service, getting the database server up and running.

Finally, we'll secure our PostgreSQL installation by creating a new user (or "role") called postgres with superuser privileges. This user will serve as our primary means of interacting with our PostgreSQL server, granting us broad administrative capabilities. Now, let's dive into these steps:

  1. Update Homebrew to ensure you have the latest package information:

    brew update

  2. Now, we are able to install PostgreSQL 14 using Homebrew by entering the following command:

    brew install [emailprotected]

  3. After the installation process is done, start the PostgreSQL service:

    brew services start [emailprotected]

  4. Once the PostgreSQL service starts, it shows the following message, then you can proceed to the next step.

    Successfully started [emailprotected]

  5. To ensure you will be able to use PostgreSQL without any issues, let’s create a new PostgreSQL user (also called a "role") named postgres with superuser privileges.

    createuser -s postgres

Step 3: Download the Northwind PostgreSQL SQL File

Now, we're going to introduce you to the Northwind database and help you download it. The Northwind database is a sample database originally provided by Microsoft for its Access Database Management System. It's based on a fictitious company named "Northwind Traders," and it contains data on their customers, orders, products, suppliers, and other aspects of the business. In our case, we'll be working with a version of Northwind that has been adapted for PostgreSQL.

The following steps will guide you on how to download this PostgreSQL-compatible version of the Northwind database from GitHub to your local machine. Let's get started:

First, you need to download a version of the Northwind database that's compatible with PostgreSQL. You can find an adapted version on GitHub. To download the SQL file, follow these steps:

  1. Open your Terminal application.

  2. Create a new directory for the Northwind database and navigate to it:

    mkdir northwind && cd northwind

  3. Download the Northwind PostgreSQL SQL file using curl:

    curl -O <>

    This will download the northwind.sql file to the northwind directory you created.

Step 4: Create a New PostgreSQL Database

Now that we've downloaded the Northwind SQL file, it's time to prepare our PostgreSQL server to host this data. The next steps will guide you in creating a new database on your PostgreSQL server, a crucial prerequisite before importing the Northwind SQL file.

Creating a dedicated database for the Northwind data is good practice as it isolates these data from other databases in your PostgreSQL server, facilitating better organization and management of your data. These steps involve connecting to the PostgreSQL server as the postgres user, creating the northwind database, and then exiting the PostgreSQL command-line interface.

Let's proceed with creating your new database:

  1. Connect to the PostgreSQL server as the postgres user:

    psql -U postgres

  2. Create a new database called northwind:

    postgres-# CREATE DATABASE northwind;

  3. Exit the psql command-line interface:

    postgres-# \\q

Step 5: Import the Northwind SQL File

We're now ready to import the Northwind SQL file into our newly created northwind database. This step is crucial as it populates our database with the data from the Northwind SQL file, which we will use for our PostgreSQL learning journey.

These instructions guide you through the process of ensuring you're in the correct directory in your Terminal and executing the command to import the SQL file. This command will connect to the PostgreSQL server, target the northwind database, and run the SQL commands contained in the northwind.sql file.

Let's move ahead and breathe life into our northwind database with the data it needs!

With the northwind database created, you can import the Northwind SQL file using psql. Follow these steps:

  1. In your Terminal, ensure you're in the northwind directory where you downloaded the northwind.sql file.
  2. Run the following command to import the Northwind SQL file into the northwind database:

    psql -U postgres -d northwind -f northwind.sql

    This command connects to the PostgreSQL server as the postgres user, selects the northwind database, and executes the SQL commands in the northwind.sql file.

Step 6: Verify the Northwind Database Installation

You've successfully created your northwind database and imported the Northwind SQL file. Next, we must ensure everything was installed correctly, and our database is ready for use.

These upcoming steps will guide you on connecting to your northwind database, listing its tables, running a sample query, and finally, exiting the command-line interface. Checking the tables and running a sample query will give you a sneak peek into the data you now have and verify that the data was imported correctly. This means we can ensure everything is in order before diving into more complex operations and analyses.

To verify that the Northwind database has been installed correctly, follow these steps:

  1. Connect to the northwind database using psql:

    psql -U postgres -d northwind

  2. List the tables in the Northwind database:

    postgres-# \\dt

    You should see a list of Northwind tables: categories, customers, employees, orders, and more.

  3. Run a sample query to ensure the data has been imported correctly. For example, you can query the customers table:

    postgres-# SELECT * FROM customers LIMIT 5;

    This should return the first five rows from the customers table.

  4. Exit the psql command-line interface:

    postgres-# \\q

Congratulations! You've successfully installed the Northwind database in PostgreSQL using an SQL file and psql.

Step 7: Connect to the Database Using Jupyter Notebook

As we wrap up our installation, we will now introduce Jupyter Notebook as one of the tools available for executing SQL queries and analyzing the Northwind database. Jupyter Notebook offers a convenient and interactive platform that simplifies the visualization and sharing of query results, but it's important to note that it is an optional step. You can also access Postgres through other means. However, we highly recommend using Jupyter Notebook for its numerous benefits and enhanced user experience.

To set up the necessary tools and establish a connection to the Northwind database, here is an overview of what each step will do:

  1. !pip install ipython-sql: This command installs the ipython-sql package. This package enables you to write SQL queries directly in your Jupyter Notebook, making it easier to execute and visualize the results of your queries within the notebook environment.

  2. %load_ext sql: This magic command loads the sql extension for IPython. By loading this extension, you can use the SQL magic commands, such as %sql and %%sql, to run SQL queries directly in the Jupyter Notebook cells.

  3. %sql postgresql://[emailprotected]:5432/northwind: This command establishes a connection to the Northwind database using the PostgreSQL database system. The connection string has the following format:


    In this case, username is postgres, hostname is localhost, port is 5432, and database_name is northwind. The %sql magic command allows you to run a single-line SQL query in the Jupyter Notebook.

  4. Copy the following text into a code cell in the Jupyter Notebook:

    !pip install ipython-sql
    %load_ext sql
    %sql postgresql://[emailprotected]:5432/northwind

  5. Run the cell by either:

    • Clicking the "Run" button on the menu bar.
    • Using the keyboard shortcut: Shift + Enter or Ctrl + Enter.
  6. Upon successful connection, you should see an output similar to the following:

    'Connected: [emailprotected]'

    This output confirms that you are now connected to the Northwind database, and you can proceed with the guided project in your Jupyter Notebook environment.

Once you execute these commands, you'll be connected to the Northwind database, and you can start writing SQL queries in your Jupyter Notebook using the %sql or %%sql magic commands.

Next Steps

Based on what you've accomplished, here are some potential next steps to continue your learning journey:

  1. Deepen Your SQL Knowledge:
    • Try formulating more complex queries on the Northwind database to improve your SQL skills. These could include joins, subqueries, and aggregations.
    • Understand the design of the Northwind database: inspect the tables, their relationships, and how data is structured.
  2. Experiment with Database Management:
    • Learn how to backup and restore databases in PostgreSQL. Try creating a backup of your Northwind database.
    • Explore different ways to optimize your PostgreSQL database performance like indexing and query optimization.
  3. Integration with Python:
    • Learn how to use psycopg2, a popular PostgreSQL adapter for Python, to interact with your database programmatically.
    • Experiment with ORM (Object-Relational Mapping) libraries like SQLAlchemy to manage your database using Python.


How to install PostgreSQL 14 in Mac? ›

Installing PostgreSQL on Mac Using the DMG Package Installer
  1. Open your favorite web browser, and navigate to the PostgreSQL download website.
  2. Next, click the download icon under the Mac OS X column next to the version you wish to install. ...
  3. Once the download completes, double-click the DMG file to open it.
Jan 4, 2023

How to install psql on macOS? ›

To install Postgres on macOS, firstly download Postgres for macOS> launch the setup wizard > specify installation directory> select components to be installed > specify data directory, superuser password, port number, and locale> review the pre-installation summary and hit the next button to start Postgres installation ...

How to install postgres 14? ›

In this post, we will explain how to install and configure PostgreSQL 14 on Ubuntu 20.04.
  1. Prerequisites. ...
  2. Step 1 – Create Atlantic.Net Cloud Server. ...
  3. Step 2 – Install PostgreSQL 14. ...
  4. Step 3 – Create a Database and User in PostgreSQL. ...
  5. Step 4 – Configure PostgreSQL for Remote Access. ...
  6. Conclusion.

How to install postgres on Mac using homebrew? ›

  1. In your command-line run the command: brew install postgresql@14.
  2. Run the command: ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents.
  3. Create two new aliases to start and stop your postgres server. ...
  4. Run the alias you just created: pg_start . ...
  5. Run the command: createdb `whoami`

How to update PostgreSQL version on mac? ›

Just open the app, and select “Check For Updates…” from the “Postgres” menu. While the self-update of Postgres. app and the bundled PostgreSQL binaries generally is an easy and painless process, we recommend to perform some additional steps: Read the release notes of Postgres.

How to install PostGIS for PostgreSQL 14? ›

Step 1: Install Packages for PostGIS
  1. Option 1 - Install on Ubuntu. Optional - Check Compatibility. ...
  2. Option 2 - Install on Vultr Managed Databases for PostgreSQL. On Vultr Managed Databases for PostgreSQL, the PostGIS extension package is already installed. ...
  3. Check Availability. ...
  4. Load the Extension. ...
  5. Check Installation.
Jan 12, 2023

How to install psql in Mac terminal? ›

How to Install psql on Mac, Ubuntu, Debian, Windows
  1. Introduction on psql.
  2. Before You Start.
  3. Install on MacOS Using Homebrew.
  4. Install on Ubuntu 16.04,18.04 and Debian 9,10.
  5. Install Windows 10.
  6. Last Step: Connect to Your PostgreSQL Server.
Aug 22, 2019

How do I find my PSQL version on Mac? ›

Follow the below-given stepwise guidelines to check the currently installed Postgres version on your system via the command prompt.
  1. Step1: Access Bin Directory. ...
  2. Step2: Check Postgres Version. ...
  3. Step 1: Expand “Servers” Tree. ...
  4. Step 2: Select Properties.

How to install and start Postgres on mac? ›

  1. Start PostgreSQL server. pg_ctl -D /usr/local/var/postgres start. Or you can start the PostgreSQL server and have it start up at login automatically brew services start postgresql.
  2. Stop PostgreSQL server. pg_ctl -D /usr/local/var/postgres stop. ...
  3. Restart PostgreSQL server. pg_ctl -D /usr/local/var/postgres restart.

Where is PostgreSQL 14 config file? ›

PostgreSQL configuration files are stored in the /etc/postgresql/<version>/main directory. For example, if you install PostgreSQL 14, the configuration files are stored in the /etc/postgresql/14/main directory. Tip: To configure IDENT authentication, add entries to the /etc/postgresql/*/main/pg_ident.

What is new in Postgres 14? ›

Aside from query pipelining, the latest PostgreSQL 14 release brings several other enhancements to query parallelism, including improved performance of parallel sequential scans, parallel query execution capabilities for Foreign Data Wrappers, and the ability to run parallel queries when refreshing materialized views.

How to install JDBC driver for PostgreSQL in Mac? ›

Set Up Data Source Using Database Explorer App
  1. Open the Database Explorer app by clicking the Apps tab on the MATLAB® Toolstrip. ...
  2. In the Data Source section, select Configure Data Source > Configure JDBC data source. ...
  3. In the Name box, enter a name for your data source. ...
  4. From the Vendor list, select PostgreSQL .

How to install PostgreSQL on Mac using Docker? ›

Install Postgres in Docker on macOS
  1. Install Docker. You can download the Docker installer from the Docker website. ...
  2. Get the Official Postgres Docker Image. ...
  3. Set the Master Password and Run. ...
  4. Ensure that Postgres is Running. ...
  5. Username and Password for Postgres in Docker. ...
  6. Connect to Postgres in Docker.

How to install Homebrew from terminal on macOS? ›

How to install Homebrew on Mac
  1. Open Terminal and type the following command: xcode-select --install.
  2. In the new dialog window, confirm you want to install the Xcode tools.
  3. Agree to a license agreement and wait for the installation process to complete. It might take a while.
Aug 15, 2022

Is Postgres version 14 obsolete? ›

The PostgreSQL version 14 is obsolete, but the server or client packages are still installed. Please install the latest packages ( postgresql-15 and postgresql-client-15 ) and upgrade the existing clusters with pg_upgradecluster (see manpage).

How to UPDATE PostgreSQL 14? ›

High-Level pg_upgrade upgrade steps include:
  1. Install PostgreSQL 14 binaries.
  2. Initialize PostgreSQL cluster.
  3. Install extensions.
  4. Execute pg_upgrade with -c option (Consistency check)
  5. Execute pg_upgrade and review logs.
  6. Validation of data/objects.
Dec 7, 2022

How to change PostgreSQL version? ›

Run pg_upgrade
  1. Run pg_upgrade.
  2. Always run the pg_upgrade binary of the new server, not the old one. ...
  3. If you use link mode, the upgrade will be much faster (no file copying) and use less disk space, but you will not be able to access your old cluster once you start the new cluster after the upgrade.

What is the difference between PostgreSQL and PostGIS? ›

What is PostgreSQL/PostGIS? PostgreSQL is an open-source relational database management system, which means you can download and use it for free. PostGIS is a database extension that is run alongside PostgreSQL and allows you to do spatial operations, store data, geometries, build spatial indexes and more.

How do I download PostGIS on my Mac? ›

To install PostgreSQL and PostGIS on a Mac, you can use Postgres. app . You can download the file from After the file has downloaded, move it to the applications folder and double-click it.

How do I know if postgres is installed on PostGIS? ›

In order to know if Postgis is correctly install, open a PostgreSQL connection or PgAdmin and type :
  1. select version (); or SHOW server_version; . It will give you the PostgreSQL version.
  2. select postgis_full_version () ; It will give you the Postgis version.

How to add PostgreSQL to path in Mac? ›

Add Postgres to Your PATH

Open the Contents folder, then the Versions folder, then select your version folder (in this case, 14). Ctrl-click the bin folder and hold the options button on your keyboard, then select Copy bin as Pathname to add the path to your clipboard.

How to install PostgreSQL using terminal? ›

Install PostgreSQL from PostgreSQL Apt Repository
  1. Step 1: Add PostgreSQL Repository. To install from the official repository, you first need to add it to your system. ...
  2. Step 2: Update the Package List. After adding the official PostgreSQL repository, make sure to update the package list. ...
  3. Step 3: Install PostgreSQL.
Jan 9, 2020

How to check PostgreSQL version? ›

  1. Navigate to the {CD_Installation_Folder}\Connect Direct v4.8.0\PostgreSQL\bin folder.
  2. Run the command psql.exe --port=port_number -U username.
  3. Enter the database password.
  4. Run the query: SELECT version();
Jul 12, 2022

What is the alternative for psql in Mac? ›

  • 312. SQLite. Free • Open Source. ...
  • 283. PostgreSQL. Free • Open Source. ...
  • 286. MySQL Community Edition. Free • Open Source. ...
  • 140. MongoDB. Freemium • Proprietary. ...
  • 129. MariaDB. Free • Open Source. ...
  • CouchDB. Free • Open Source. Mac. ...
  • Microsoft SQL Server. Freemium • Proprietary. Relational Database. ...
  • Apache Cassandra. Free • Open Source.
Feb 14, 2022

Where is psql installed? ›

All files will be installed under /usr/local/pgsql by default. You can customize the build and installation process by supplying one or more command line options to configure . Typically you would customize the install location, or the set of optional features that are built.

What is the latest version of psql? ›

157 months and 3 weeks ago (10 Oct 2022)15.3 (08 May 2023)
141 year and 8 months ago (27 Sep 2021)14.8 (08 May 2023)
132 years and 8 months ago (21 Sep 2020)13.11 (08 May 2023)
123 years and 8 months ago (30 Sep 2019)12.15 (08 May 2023)
15 more rows
May 10, 2023

Is Postgres installed on Mac by default? ›

1 Answer. Save this answer. Show activity on this post. Postgres is not installed by default and removing /Library/PostgreSQL won't brick your system AFAIK, have done that several times myself.

How do I uninstall and install PostgreSQL on Mac? ›

How to uninstall PostgreSQL manually
  1. Go to Applications > Utilities and launch Terminal.
  2. Type the following command: open /Library/PostgreSQL/9.2/
  3. Press Return and type in your admin password when prompted.
  4. Follow the instructions on screen.
May 27, 2022

How to check if Postgres is running? ›

Use the “sudo systemctl status postgresql” command to check the PostgreSQL service status in Linux. Users can also use the “sudo systemctl is-active postgresql” and “sudo systemctl is-enabled postgresql” commands to check if the Postgres service is active and enabled.

What is the default port for Postgres 14? ›

The PostgreSQL database service is available on localhost and the default PostgreSQL port is 5432 .

What is the default username for Postgres 14? ›

Login and Connect as Default User

For most systems, the default Postgres user is postgres and a password is not required for authentication.

What is the default data directory in PostgreSQL 14? ›

This output confirms that PostgreSQL is configured to use the default data directory, /var/lib/postgresql/14/main , so that's the directory you need to move.

How to manually install PostgreSQL? ›

Installing PostgreSQL Manually
  1. Add the hostname/IP of the database server to the CCC server's /etc/hosts file.
  2. Download and install the PostgreSQL RPM.
  3. Initialize the database.
  4. Configure PostgreSQL to use syslog, if desired.
  5. Configure the PostgreSQL listen address.
  6. Configure PostgreSQL to use SSL.

How to install PostgreSQL in Mac M1? ›

Install with Homebrew:
  1. $ brew install postgresql@14. (The version number 14 needs to be explicitly stated. ...
  2. $ pg_ctl -D /opt/homebrew/var/postgresql@14 start. Note: if you're on Intel, the /opt/homebrew probably is /usr/local . ...
  3. $ psql postgres. ...
  4. $ psql postgres -U myuser.

Can I install 2 versions of PostgreSQL? ›

If you are looking to install and manage multiple versions of postgresql in your Server then pgenv or PostgreSQL binary manager is one of the best option you can choose here. Using pgenv, it is very easy to install, stop and start postgresql cluster instances.

Is PostgreSQL 14 backwards compatible? ›

If you're running a production database, this may be easier said than done, especially if we are talking about upgrading your major version (e.g., from PostgreSQL 13 to PostgreSQL 14): Minor versions of PostgreSQL (e.g., from PostgreSQL 13 to PostgreSQL 13.2) are always backward compatible with the major version.

Is Postgres 14 faster than 11? ›

Overall, pg 11 is faster than pg 14, especially on ZFS with the default 128K recordsize.

How do I stop PostgreSQL 14 on Mac? ›

Stopping a running server (macOS)
  1. cd /Library/PostgreSQL/<version>/bin. ...
  2. pg_ctl stop -D /Library/PostgreSQL/<version>/data. ...
  3. sudo lsof -i:5432. ...
  4. sudo kill -15 <process id> ...
  5. cd /Library/PostgreSQL/<version>/bin. ...
  6. pg_ctl start -D /Library/PostgreSQL/<version>/data. ...
  7. ALTER USER postgres WITH ENCRYPTED PASSWORD 'new-password';
Nov 16, 2021

How to install JDBC driver for Mac? ›

Downloading the JDBC Driver
  1. On your Mac client system, open a browser and log into the myVertica portal.
  2. Navigate to the Downloads page, scroll to the Client Software download section, and click the download link for the JDBC driver.
  3. Accept the license agreement and wait for the download to complete.

How to install ODBC driver for PostgreSQL? ›

Configuring a PostgreSQL ODBC connection on Windows
  1. Download the PostgreSQL ODBC 64-bit driver.
  2. Install the PostgreSQL ODBC driver on the machine where the Secure Agent is installed.
  3. Open the folder in which ODBC data source file is installed.
  4. Run the. odbcad32.exe. ...
  5. Click. ...
  6. Click. ...
  7. Select the PostgreSQL driver and click. ...
  8. Click.

What is the driver name for PostgreSQL? ›


What is the default port for PostgreSQL? ›

By default, the Postgresql database listens on port 5432.

How to connect PostgreSQL in Docker container? ›

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers.
  1. Step 1 — Install PostgreSQL DB instance. ...
  2. Step 2 — Create file ...
  3. Step 3 — Create Dockerfile. ...
  4. Step 4 — Create Docker image from the Dockerfile. ...
  5. Step 5 — Start container.
Dec 3, 2022

How to run PostgreSQL and pgAdmin using Docker? ›

Now we need to run pgAdmin in a Docker container by setting a full command calling the image “dpage/pgadmin4” with the following information:
  1. Environment variables: User/Email and Password.
  2. Port.
  3. Network: the same network that you set for PostgreSQL.
  4. Name for the container.
Jan 9, 2023

How to install packages in macOS terminal? ›

How to Install Homebrew on a Mac
  1. Step 1: Install Command Line Tools. Open Terminal and run the following command: xcode-select --install. ...
  2. Step 2: Install Homebrew. Run the following command from the Homebrew website into Terminal: ...
  3. Step 3: Verify the Homebrew Installation. To verify the installation, run:
Dec 2, 2021

Is it safe to use Homebrew on Mac? ›

Homebrew can't ruin macOS itself (due to system integrity protection; write-locked storage for macOS itself, etc), but it can (potentially) snarl the users' storage areas, and it absolutely can alter user details such as PATH.

Is Homebrew automatically installed on Mac? ›

On Mac Intel, Homebrew installs itself into the /usr/local/bin directory, which is already configured for access by the shell with the macOS default $PATH environment variable (the default is set by the /usr/libexec/path_helper command).

How to install PostgreSQL 15? ›

How to Install PostgreSQL 15 on Ubuntu 22.04
  1. Enable the PostgreSQL Package Repository. First, get the latest packages. ...
  2. Install PostgreSQL 15 Database Server and Client. ...
  3. Change the Password for the PostgreSQL Admin User. ...
  4. Set up PostgreSQL for Remote Access. ...
  5. Checking Remote Connection.
Mar 9, 2023

How to install PostgreSQL from command line? ›

Set Up a PostgreSQL Database on Windows
  1. Download and install a PostgreSQL server. ...
  2. Add the PostgreSQL bin directory path to the PATH environmental variable. ...
  3. Open the psql command-line tool: ...
  4. Run a CREATE DATABASE command to create a new database. ...
  5. Connect to the new database using the command: \c databaseName.

How do I know if Postgres is installed on my Mac? ›

To check which Postgres version is active on your system, users can run “psql –version” command from the command prompt, the “SELECT VERSION()” command from SQL Shell, or expand the “Servers” tree, left-click on “PostgreSQL” and then click on the properties tab to check the Postgres Version via pgAdmin.

What is the latest PostgreSQL version? ›

October 13, 2022 - The PostgreSQL Global Development Group today announced the release of PostgreSQL 15, the latest version of the world's most advanced open source database.

Do I need to install stack builder for PostgreSQL? ›

Stack Builder is optional, you can uncheck if you wish or just keep the default selection and click on Next. Above, select the directory where you want to store data or go ahead with default selection and click on the Next button.

How to install Postgres on mac through terminal? ›

Install Postgres Database with Homebrew

Homebrew site has a simple command that you have to paste in your terminal to do so. Make sure to accept the command line developer tools installation if prompted. Next, run brew install postgres to install Postgres. It might take a little while to compile and install.

How to run PostgreSQL on Mac? ›

  1. Start PostgreSQL server. pg_ctl -D /usr/local/var/postgres start. Or you can start the PostgreSQL server and have it start up at login automatically brew services start postgresql.
  2. Stop PostgreSQL server. pg_ctl -D /usr/local/var/postgres stop. ...
  3. Restart PostgreSQL server. pg_ctl -D /usr/local/var/postgres restart.

How to install psql in docker container? ›

What are the 3 Steps to set up Docker PostgreSQL Environment
  1. Step 1: Download and Install Docker. Image Source: Self. ...
  2. Step 2: Download the Docker PostgreSQL Image. There are two different ways to download the Docker PostgreSQL Image that allows you to set up PostgreSQL on Docker. ...
  3. Step 3: Install PGAdmin on Docker.
Feb 7, 2022


Top Articles
Latest Posts
Article information

Author: Pres. Carey Rath

Last Updated: 09/16/2023

Views: 6047

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Pres. Carey Rath

Birthday: 1997-03-06

Address: 14955 Ledner Trail, East Rodrickfort, NE 85127-8369

Phone: +18682428114917

Job: National Technology Representative

Hobby: Sand art, Drama, Web surfing, Cycling, Brazilian jiu-jitsu, Leather crafting, Creative writing

Introduction: My name is Pres. Carey Rath, I am a faithful, funny, vast, joyous, lively, brave, glamorous person who loves writing and wants to share my knowledge and understanding with you.