Installing PostgreSQL on Mac
Last updated
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)"Once Homebrew is installed, run
brew install postgresqlExplanation: This command downloads and installs PostgreSQL via Homebrew.
Start the PostgreSQL service.
brew services start postgresqlExplanation: This ensures PostgreSQL runs in the background, even after restarting your Mac.
Check if PostgreSQL is running
brew services listExplanation: This shows all services managed by Homebrew and their statuses.
Access PostgreSQL:
Explanation: Opens the PostgreSQL interface connected to the default postgres database.
Last updated
psql postgres