I installed PostgreSQL via the graphical install on http://www.postgresql.org/download/macosx/
I see it in my applications and also have the psql terminal in my applicat
Modify your PATH
in .bashrc
, not in .bash_profile
:
http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
ANSWERED ON OCTOBER 2017
run
export PATH=/Library/PostgreSQL/9.5/bin:$PATH
and then restart your terminal.
For me this worked:
Downloading the App: https://postgresapp.com/downloads.html
Running commands to configure $PATH - note though that it didn't work for me. https://postgresapp.com/documentation/cli-tools.html
Manually add it to the .bash_profile document:
cd # to get to your home folder
open .bash_profile # to open your bash_profile
In your bash profile add:
# Postgres
export PATH=/Applications/Postgres.app/Contents/Versions/latest/bin
Save the file. Restart the terminal. Type 'psql'. Done.
From the Postgres documentation page:
sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
restart your terminal and you will have it in your path.
If someone used homebrew with Mojave or later:
export PATH=/usr/local/opt/postgresql@9.5/bin:$PATH
change version if you need!