Install PostgreSQL 11 on Mac OS X
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation.
Download the postgresql package
You can go to the following, link to download the package and select the postgresql version and your operating system (Mac OS)
You might also like: How to install postgresql 11 on Mac OS X via brew
Install Postgres 11 on Mac OS X
Now you need to install the postgresql package. Just click on the downloaded package and follow the instructions. You need to set the password for Postgres superuser password.
Set environment variable for mac
You need to set the environment variable in order to work with postgresql through the command line.
Open the terminal in your mac and the open profile file with an editor and paste the below line in your profile file
(Profile file can be .profile or .bash_profile in your home directory)
Then source your profile file or log out and log in again.
Then try to login with Postgres user and password.
psql -U postgres -h localhost Password for user postgres: psql (11.0) Type "help" for help. postgres=#
Now postgresql database is set up and you can login and create new users and password.
If you got some issues installing postgresql on mac please feel free to comment below.
Read Also: How to backup postgresql database