1、先用源码安装9.3
2、修改环境变量path
3、初始化9.3数据库
initdb -E utf8 --locale=zh_CN.UTF8 -D /Users/heyong/opt/pgsql93/data/
4、安装pg_upgrade、pg_upgrade_support
contrib目录下(可能需要把so文件拷贝到lib目录)
6、执行升级
@H_301_23@ pg_upgrade -d /Users/heyong/opt/pgsql/data -D /Users/heyong/opt/pgsql93/data/ -b /Users/heyong/opt/pgsql/bin/ -B /Users/heyong/opt/pgsql93/bin/7、拷贝pg_hba.conf,pg_ident.conf,postgresql.conf 文件
8、启动数据库
如果报
@H_301_23@ connection to database Failed: FATAL: must be superuser to connect in binary upgrade mode @H_301_23@ export PGUSER=www 原文链接:https://www.f2er.com/postgresql/195902.html