PostgreSQL: command not found
When you say "going to", it sounds like you're using the cd
command to change to that directory. Something like:
$ cd /opt/local/lib/postgresql84/bin$ psqlpsql: command not found
Normally on Unix systems, the current directory is not part of your executable search path. So either explicitly execute psql
from the current directory using ./
:
$ cd /opt/local/lib/postgresql84/bin$ ./psql
or, add the directory to your PATH
:
$ export PATH=/opt/local/lib/postgresql84/bin:$PATH$ psql
I had installed postgres (Mac,The capitan SO) with the dmg and also I got the same issue. I had to install psql through brew. Try with this :
brew install postgres
This worked for me.