As an open source object-relational database management system, PostgreSQL available for MacOS, Linux, and Windows.
The goal will be to run the following command successfully from the command line (regardless of the OS):
psql -U postgres
This should open the psql interactive shell and print a prompt that looks like:
postgres=#
Let's walk through installing PostgreSQL with the postgresapp on Mac.
- Visit http://postgresapp.com/
- Download the most recent version --> Click "Download"
- Open the application, and click "initialize" to create a new PostgreSQL server
- Ensure that the Postgres.app bin folder has been added to your $PATH;
4.1) In the command line, enter:
echo "$PATH"
4.2) Search through the output and make sure Postgres.app/Contents/Version/latest/bin is there in order to ensure that this directory's executables are callable from any directory in bash. - In the command line, enter:
lsof -i tcp:5432
, and ensure that the postgresCOMMAND
appears. This checks if the Postgres server is now running on port 5432 under the namelocalhost:postgresql
- Acquire the source code:
wget ftp://ftp.postgresql.org/pub/source/v9.3.2/postgresql-9.3.2.tar.bz2
- Install the packages needed for building Postgres:
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev
- Download the installer specified by EnterpriseDB for all supported PostgreSQL versions. The installer is available here: https://www.postgresql.org/download/windows/
Hi guys!!
Just a tip to help people from losing extended periods of time (like I've done) it seems current versions of PostSQL don't require '10' (and slash - not showing in this comment for some reason) in the System Variables as the directory no longer seems to exist. It all seems to be working fine now!