Postgresql major version upgrade on ubuntu

the first way

pg_dumpall -p 5432 | psql -d postgres -p 5433

the second way

First install two versions of the database 9.5 and 9.5

sudo service postgresql stop

sudo pg_dropcluster 9.5 main ; do not perform this step wrong, delete the old database

sudo pg_upgradecluster -v 9.5 9.3 main

After the new database is normal, delete the old database

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326516603&siteId=291194637