I upgraded Postgres from 9.3 to 9.4. But when I login to server then it is showing 9.3.

see the screenshot details below:

$ psql --version
psql (PostgreSQL) 9.4.10
$ pg_dump --version
pg_dump (PostgreSQL) 9.4.10
psql (9.4.10, server 9.3.13)
Type "help" for help.

postgres=# select version();
PostgreSQL 9.3.13 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4, 64-bit
        (1 row)

How can I upgrade it? What is the issue?

Updated: After running pg_lsclusters, it is showing:

Ver Cluster Port Status Owner    Data directory               Log file
9.3 main    5432 online postgres /var/lib/postgresql/9.3/main /var/log/postgresql/postgresql-9.3-main.log
  • How did you upgrade ? Please write your steps to find where the mistake is. You may want to check Upgrading a PostgreSQL Cluster or pg_upgrade
    – Sahap Asci
    Dec 30 '16 at 13:03
  • 1
    Try the magic pg_lsclusters command, it will show you if you have 2 running instance (or more), you may still connect on the 9.3 if you don't specify the right port.
    – Rodolphe
    Dec 30 '16 at 15:57

You didn't upgrade the database. You're likely on a system that permits different versions of PostgreSQL to run concurrently and you likely have two versions of the server running on two different ports. Usually 5432..543x. You'll have to

  1. use pg_dump on the server running with the old port (the one you're connecting to here).
  2. use pg_restore on the server running with the new port (that you probably didn't even know was running)


sudo rgrep -i "port =" /etc/postgresql

Or, if you have Debian/Ubuntu, run pg_lsclusters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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