Steffen San
Steffen San

Reputation: 13

PostgreSQL different psql and server versions. Can't update or locate psql's destination

I will keep it short for the people who don't want to read too much. Currently, I am trying to run PostgreSQL.app 9.3.0. (Homebrew didn't work and complained that there might be conflicting versions).

It seems to run pretty well, however my psql's version is 9.1.0 and it causes some problems. Psql is probably a left over from another installation/uninstallation maybe a year ago.

Is there a way to update psql or locate it so that I can re-install it. Maybe these two screenshots maybe will give you an idea.

Thank you!

https://i.sstatic.net/PvKmO.png https://i.sstatic.net/04ZOK.png

Upvotes: 0

Views: 1075

Answers (1)

douglasr
douglasr

Reputation: 1959

Use the 'which' command in the terminal to determine the path/location of the command in question. For example:

$ which psql
/Library/PostgreSQL/9.3/bin/psql

The first image you posted is likely a result of running the psql that comes with default OS X installs. That version is located at:

/usr/bin/psql

I wouldn't recommend removing it however. Instead, once you've installed a version of psql that matches your server (or perhaps it's already there but is just behind the other version in your path), update your path so that the proper psql command comes before the default OS X one and any others. If you are using bash as your preferred shell, for example, then put this in your ~/.bash_profile file:

# add PostgreSQL binaries to the path
export PATH=/Library/PostgreSQL/9.3/bin:$PATH

Upvotes: 2

Related Questions