PostgreSQL 13 升级与补丁操作指南
1. 准备 pglogical 扩展
在进行 PostgreSQL 不同版本间的逻辑复制前,需要在新旧集群上设置相关参数并创建 pglogical
扩展。
- 旧集群(PostgreSQL 9.6) :
$ /usr/pgsql-9.6/bin/psql -c "ALTER SYSTEM SET wal_level TO 'logical'"
$ /usr/pgsql-9.6/bin/psql -c "ALTER SYSTEM SET shared_preload_libraries TO pglogical"
$ /usr/pgsql-9.6/bin/psql -d percona -c "CREATE EXTENSION pglogical"
- 新集群(PostgreSQL 13) :
$ /usr/pgsql-13/bin/psql -c "ALTER SYSTEM SET wal_level TO 'logical'"
$ /usr/pgsql-13/bin/psql -c "ALTER SYSTEM SET shared_preload_libraries TO pglogical"
$ /usr/pgsql-13/bin/psql -c "CREATE DATABASE percona"
$ /usr/pgsql-13/bin/p