I'm on a Mac 10.11 running psql -h localhost -U monitor -W postgres and I kept getting

-bash: psql: command not found

This is what I have in my paths.

  • How did you install pgsql ? – sebastienvg Aug 22 '16 at 18:53
  • I install a Mac app call postgres – kyo Aug 22 '16 at 18:53
  • I usually prefer to use a package manager such as homebrew or fink, anyway I'll try to give you a hand, is it the one you have installed postgresapp.com ? – sebastienvg Aug 22 '16 at 18:57
  • Yes, that's it. That is the one. – kyo Aug 22 '16 at 19:16
  • 1
    Yes you want to follow the instructions from this page postgresapp.com/documentation/cli-tools.html in clear just export your path and then you should be good to go. – sebastienvg Aug 22 '16 at 20:45

If you have installed Postgres using Postgres app then you need to add psql in your path. Change the Postgres version in the following command.

export PATH=/Library/PostgreSQL/9.6/bin/:$PATH 

Or you can add the above line in ~/.bash_profile or ~/.profile

and then execute the following command

source ~/.bash_profile


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.