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、执行升级
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、启动数据库
如果报
connection to database Failed: FATAL: must be superuser to connect in binary upgrade mode
export PGUSER=www
原文链接:https://www.f2er.com/postgresql/195902.html