Installing PostgreSQL using homebrew on macOS
PostgreSQL is a powerful, open-source relational database system. It has a strong reputation for reliability, feature robustness, and performance.
To install PostgreSQL on macOS using Homebrew, simply run the following command in your terminal:
$ brew install postgresql
This will install the latest stable version of PostgreSQL on your machine.
First, it will try to update your homebrew application, and then it will install PostgreSQL.
It will then install icu4c and openssl along with its dependencies.
icu4c is a set of C and C++ libraries that provides Unicode and globalization support for software developers. It is used by PostgreSQL to provide internationalization support for database applications.
OpenSSL is a software library that provides a secure communications protocol for applications. It is used by PostgreSQL to provide encryption support for database communications.
Once the dependencies are installed, the PostgreSQL installation will begin.
Check out the above video to see the screencast of postgreSQL installation.
After the installation of PostgreSQL is completed, you can initialize a database cluster using the initdb command:
$ initdb /usr/local/var/postgres -E utf8
It will create a new database cluster in the /usr/local/var/postgres directory with the encoding set to UTF-8.