--对于小版本的升级,内部存储格式是兼容的,大版本不一定兼容
--小版本可以直接替换二进制文件,大版本需要导出与导入升级
Minor releases never change the internal storage format and are always compatible with earlier and later minor releases of the same major version number, e.g., 8.4.2 is compatible with 8.4,8.4.1 and 8.4.6.
To update between compatible versions, you simply replace the executables while the server is down and restart the server. The data directory remains unchanged — minor upgrades are that simple.
For major releases of PostgreSQL, the internal data storage format is subject to change, thus complicating upgrades. The traditional method for moving data to a new major version is to dump and reload the
database, though this can be slow. A faster method is pg_upgrade. Replication methods are also available, as discussed below.
--在使用pg_dumpall进行长级时,注意要保持数据的完整性
If making a backup, make sure that your database is not being updated. This does not affect the integrity of the backup, but the changed data would of course not be included.
If necessary, edit the permissions in the file pg_hba.conf (or equivalent) to disallow access from everyone except you
--pg_upgrade用于大版本的升级,但对于小版本的升级不起作用
pg_upgrade allows data stored in PostgreSQL data files to be upgraded to a later PostgreSQL major version without the data dump/reload typically required for major version
upgrades, e.g. from 8.4.7
pg_upgrade 版本升级
最新推荐文章于 2024-07-18 09:50:55 发布