PostgreSQL – Installation on MacOSX and PSQL Issues

installationpostgresqlpsql

I'm currently trying to install Postgres (using the installation package from http://postgresapp.com), i.e. downloading, unpacking, dragging the app into the Applications folder, launching the app. So far, so good.

However, when I then try to use the psql command I receive -bash: psql: command not found. I tried to follow the solutions in similar questions, but trying to locate the binaries through which psql or locate psql and so on all didn't work.

Am I doing something wrong? Could someone please provide guidance on how to make it work? Thanks!

Best Answer

Postgres.app has a short documentation here:

http://postgresapp.com/documentation/

which tells among other things:

Configure your $PATH

Postgres.app includes many command line tools. If you want to use them, you must configure the $PATH variable.

If you are using bash (default shell on OS X), add the following line to ~/.bash_profile:

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

...

Not doing that results in the error message you're getting.