Database Engineering
  • Need of Database
  • Database and Database Management System
  • What is Relational Database Model ?
  • Installing Postgresql
    • Installing PostgreSQL on Linux
    • Installing PostgreSQL on Windows
    • Installing PostgreSQL on Mac
    • Postgres in Docker
  • What happens during the initial installation ?
    • Roles, Users & Groups
    • More examples on Roles
  • Sample Databases
    • DVD Rental Database
  • Querying Data
    • SELECT Query
    • Column Aliases
    • Order By
    • SELECT DISTINCT
    • DB-TASK-001
  • Filtering Data
    • WHERE ?
    • AND Operator
    • OR Operator
    • LIMIT
    • FETCH
    • IN
    • BETWEEN
    • LIKE
    • SIMILAR TO
    • IS NULL
    • ESCAPE
    • DB-TASK-002
  • Entity Relationship Diagram
    • What is an ER Diagram ?
    • Entity
    • Identifiers
    • Relationship
    • Attributes
    • Cardinality
    • Entity Relationship Diagram Tutorial
    • DB-TASK-003
  • Joins
    • Joins
    • Joins With Employee and Departments
  • Joins on E-Commerce
Powered by GitBook
On this page
  • Step 1: Use Homebrew
  • Step 2: Install PostgreSQL
  • Step 3: Start PostgreSQL
  • Step 4: Verify Installation
  1. Installing Postgresql

Installing PostgreSQL on Mac

Step 1: Use Homebrew

Homebrew is a package manager for macOS. If you don’t have Homebrew installed, install it first by running

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2: Install PostgreSQL

Once Homebrew is installed, run

brew install postgresql

Explanation: This command downloads and installs PostgreSQL via Homebrew.

Step 3: Start PostgreSQL

Start the PostgreSQL service.

brew services start postgresql

Explanation: This ensures PostgreSQL runs in the background, even after restarting your Mac.

Step 4: Verify Installation

  1. Check if PostgreSQL is running

brew services list

Explanation: This shows all services managed by Homebrew and their statuses.

  1. Access PostgreSQL:

psql postgres

Explanation: Opens the PostgreSQL interface connected to the default postgres database.

PreviousInstalling PostgreSQL on WindowsNextPostgres in Docker

Last updated 6 months ago