How to install Postgresql Client using Homebrew

Psql is a command-line interface for interacting with PostgreSQL, a powerful and open source relational database system. Brew is a package manager for macOS that makes it easy to install and manage software. Here are the steps to install psql with brew:

  • First, install the brew package manager if you don’t have it already. You can do this by running the following command in your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Second, update brew by running the following commands:
brew doctor
brew update
  • Third, install libpq by running the command:
brew install libpq

Libpq is a library that contains psql and other PostgreSQL client utilities.