2

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
code-8
  • 444

1 Answers1

2

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

https://www.installvirtual.com/question/psql-command-not-found-mac/