7

Today I was prompted to upgrade my OS from Ubuntu 14.04 LTS to 16.04 LTS. Generally speaking, it went smoothly. However, I did receive error messages indicating that the upgrade of PostgreSQL from 9.3 to 9.5 did not succeed. I eventually was able to install postgresql-9.5 and have verified that I see my previously created databases and tables.

However, when I use the psql command to access a database called hierarchy as follows, I get some unfamiliar output:

$ psql hierarchy jkeenan
psql (9.5.3, server 9.3.13)
Type "help" for help.

Does this indicate that part of my PostgreSQL setup (broadly speaking) was not upgraded to 9.5?

Update: Once inside psql I can say SELECT version(); and get this output:

 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

How would I perform this upgrade? Is the difference between the psql version and the "server" version something I should be concerned about?

Other data which might be helpful in diagnosis:

$ createdb --version
createdb (PostgreSQL) 9.5.3
$ psql --version
psql (PostgreSQL) 9.5.3

Thank you very much.

James E Keenan
  • 281
  • 2
  • 10
  • Yes, it proved very helpful. For reference, here are the points where there was some confusion. 1. In the older, 9.3 installation, in pg_hba.conf, I had: `local all postgres md5` (for reasons I can't recall right now). I had to switch that back to `local all postgres peer` to proceed. 2. After `sudo su postgres`, you have to switch to a directory writable by user `postgres`. See http://stackoverflow.com/questions/23216734/cannot-write-to-log-file-pg-upgrade-internal-log-when-upgrading-from-postgresq. 3. I had to use `\` line separators when pasting the `pg_upgrade` command. – James E Keenan Aug 01 '16 at 13:06
  • @LaurenzAlbe link in your comment is not accessible. Could you provide the correct link? – ABN May 08 '21 at 07:49
  • @ABN I don't know if that very blog still exists. Essentially, you either have to dump the cluster and restore it into the higher version, or you have to run `pg_upgrade`. I recommend the PostgreSQL documentation. – Laurenz Albe May 10 '21 at 04:48

0 Answers0