2

I'm following this tutorial to install multiple version of Postgresql on Ubuntu 16.04 to test streaming replication
http://blog.endpoint.com/2012/08/using-different-postgresql-versions-at.html

But I installed both 9.5 and 9.6 with this command line:

sudo apt-get install postgresql-9.5 postgresql-9.6 postgresql-client-common

But when I try to do psql --cluster 9.5/main --version and psql --cluster 9.6/main --version both give me the same answer

psql (PostgreSQL) 9.6.5

which means there is only one instance that is accessible.

  • At some point (post instructions?) the default install port changed to the next port (5433 instead of 5432). Maybe you need to specify the ports? – ubfan1 Oct 1 '17 at 17:05
  • I know that they are on different ports. But how do I specify the port number when I'm using the command psql? – Ahmedn1 Oct 1 '17 at 17:46
  • Ok so I tried psql --cluster 9.5/main -p 5432 --version with port numbers from 5432 up to 5435 and the result is the same. – Ahmedn1 Oct 1 '17 at 17:47
  • Please run pg_lsclusters to display the list and status of the PG clusters as known by the pg_wrapper layer. – Daniel Vérité Oct 2 '17 at 12:33
0

According to manpage,

psql, pg_archivecleanup, and pg_isready, pg_wrapper will always use the binary from the newest PostgreSQL version installed, as these are downwards compatible.

Hence when you run either psql --cluster 9.5/main --version or psql --cluster 9.6/main --version both give me the same answer

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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