How to put psql on the path when using Postgres.app on OS X?

I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:

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

And now my terminal was able to find the path to postgres when I run which psql.

Hope this helps.


I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:

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

Now the terminal knows where to find postgres when I use the psql command.

Remember to replace the version number '9.5' with your current version.