PostgreSQL 9.4 Installation – Fix ‘psql: Command Not Found’ Error on Mac OS X

installationmac os xpostgresqlpostgresql-9.4

I downloaded and installed PostgreSQL and PostGIS from KyngChaos for my OS X 10.10 install. When I run psql I get,

bash: psql: command not found

According to the site How to run psql on Mac OS X? it gets installed into /Library/PostgreSQL. There is no file there.

Best Answer

According to the README included in the dmg file, postgres binaries are installed in /usr/local/pgsql/bin/. You should add these lines in your ~/.bashrc :

export PSQL_DIR=/usr/local/pgsql/bin/
export PATH="$PSQL_DIR:$PATH"

Update your environment with source ~/.bashrc or run a new shell and psql should be available.