2

I downloaded and installed PostgreSQL and PostGIS from KyngChaos for my OS X 10.10 install. When I run psql I get,

bash: psql: command not found

According to the site How to run psql on Mac OS X? it gets installed into /Library/PostgreSQL. There is no file there.

  • I've deleted irelevant and incorrect information, if locate didn't work your locatedb was out of date. and PostGIS has nothing to do with the PATH or PostgreSQL. Also, in the future, use brew. =) – Evan Carroll Dec 7 '17 at 23:20
4

According to the README included in the dmg file, postgres binaries are installed in /usr/local/pgsql/bin/. You should add these lines in your ~/.bashrc :

export PSQL_DIR=/usr/local/pgsql/bin/
export PATH="$PSQL_DIR:$PATH"

Update your environment with source ~/.bashrc or run a new shell and psql should be available.

  • Would that be the command for a mac as well? – Stophface Apr 15 '15 at 9:55
  • For sure, i'm using these on my Mac (; – DeadEye Apr 15 '15 at 9:56
  • Thanks. That worked like a charme. Another questions. It seems that I have to do the export ... every time I restart my computer. Is there a way to do it permanently? – Stophface Apr 16 '15 at 14:21
  • Create a new file in your home directory named .bashrc and add these lines in this files. Your terminal will then load run these lines each time your open a terminal. – DeadEye Apr 20 '15 at 12:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.