How to download psql mac?

424    Asked by CharlesParr in SQL Server , Asked on Sep 29, 2022

I installed PostgreSQL on a computer with Mac OS X using the One click installer. Then I tried to access PostgreSQL using the psql command, but it doesn't seem to be available.

I get this message:

psql

-bash: psql: command not found

Do I have to install something more? Or how can I configure PostgreSQL so I can use it on my computer?


Answered by Chloe Burgess

To download psql mac:


Locate the psql binary. (In a terminal, run locate psql | grep /bin, and make note of the path. (In my case, it's /opt/local/lib/postgresql90/bin/, as it was installed using MacPorts.)

Then, edit the .bash_profile file in your home folder (e.g. mate -w ~/.bash_profile assuming you've textmate), and add the needed line so it's in your path, e.g.:

export PATH=/opt/local/lib/postgresql90/bin/:$PATH

After having saved the file, read the file (. ~/.bash_profile) or open a new terminal, and type psql.



Your Answer

Interviews

Parent Categories