-bash: psql: command not found

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.

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/pgsql/bin
8

1 Answer

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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like