Upgrading to a newer major version
Until very recently, the only way to upgrade an existing PostgreSQL version to a newer major version, such as going from 8.1.X to 8.2.X, was to dump and reload. The pg_dump
and/or pg_dumpall
programs are used to write the entire contents of the database to a file, using the newer versions of those programs. That way, if any changes need to be made to upgrade, the newer dumping program can try to handle them. Not all upgrade changes will happen automatically though. Then, depending on the format you dumped in, you can either restore that just by running the script it generates or use the pg_restore
program to handle that task. pg_restore
can be a much better alternative in newer PostgreSQL versions that include a version with parallel restore capabilities.
Note
If you are using a system that doesn't easily allow you to run more than one system with PostgreSQL version at a time, such as the current RedHat Linux RPM packages, getting both old and...