I have a centos 7 vm that came with postgreSQL 9.2.24 and I recently installed postgreSQL 11 from the source from their site with the commands
./configure
make
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
And that worked without any errors. In /usr/local/pgsql/data there is a file called PG_VERSION which contains "11". However when I check what version I have with
pg_config --version
It still returns the 9.2.24 version.
I'm going to install a postgres extension (timescaledb) which will use the postgres version shown by pg_config, and I want to install timescaledb with postgres 11. Also the machine has to be offline only, if that matters (which is why I installed from the source).
The part that I think may be confusing me is I don't currebtly have a database created, as I plan to create a new one when I have timescaledb ready to go.
Best Answer
As Michael said, you need to remove the install of PostgreSQL you are not using first. Its a VM, backup anything you care about, throw it away, and rebuild. Then you can check that the correct
pg_config
is found in $PATH.This will be easier if you continue with the package manager, yum in this case. You don't have to compile it, and known builds are easier to support. It will pull in dependencies and identify conflicting packages for you.
Because the OS updates don't ship a PostgreSQL new enough, choose which package you trust to install.
TimescaleDB's documentation shows how to install postgresql.org yum repo that its repo depends on.
Red Hat Software Collections also ships PostgreSQL 9.6 or 10 options.