PostgreSQL can be easily installed on macOS with Homebrew. If you do not already have Homebrew installed on your system, consult Chapter 1, The Fundamentals for its installation instructions. Once you have determined that Homebrew is installed on your system, open your terminal and run the following command:
brew search postgres
Follow the installation instructions when prompted in the Terminal. Along the course of the installation, you may be asked for the admin password of your system. Input the password and wait for the installation to finish. You will be prompted once the installation is complete.