Somewhere along the line I have ended up with a version mismatch between postgresql-9.4
and psql
which is version 9.3 despite the fact that version 9.4 is installed.
I think I need to correct the $PATH
variable but I don't know where to find this. I've looked in my /etc/.bashrc
file and can't see anything that points me in the right direction.
When I do sudo find / -name psql
the result is:
/usr/bin/psql
/usr/share/bash-completion/completions/psql
/usr/pgsql-9.4/bin/psql
yum list installed | grep postgres
yields the following:
postgresql.x86_64 9.3.9-1.fc21 @updates
postgresql-contrib.x86_64 9.3.9-1.fc21 @updates
postgresql-devel.x86_64 9.3.9-1.fc21 @updates
postgresql-libs.x86_64 9.3.9-1.fc21 @updates
postgresql-server.x86_64 9.3.9-1.fc21 @updates
postgresql94.x86_64 9.4.5-1PGDG.f21 @pgdg94
postgresql94-libs.x86_64 9.4.5-1PGDG.f21 @pgdg94
postgresql94-server.x86_64 9.4.5-1PGDG.f21 @pgdg94
Use the alternatives mechanism. On Fedora:
As Craig Ringer answered - generally you should use:
Nevertheless, sometimes you can get such message back:
If so - try:
You're apparently using CentOS or RHEL.
In this case, you might: 1) invoke psql with the full path or 2) replace the current psql in the alternatives by executing the following command as
root
:A tip: use
updatedb
andlocate
instead offind
whenever looking for a file or directory. :D