1

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
psql (9.4.10, server 9.3.13)
Type "help" for help.
postgres=# select version();
 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:

pg_lsclusters
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
asked Dec 30, 2016 at 10:26
2
  • 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 Commented Dec 30, 2016 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. Commented Dec 30, 2016 at 15:57

1 Answer 1

2

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)

Try

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

Or, if you have Debian/Ubuntu, run pg_lsclusters

answered Dec 30, 2016 at 16:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.