我正在Macbook Pro(我的开发机器)上升级Postgres.app,运行时遇到错误:
pg_upgrade -b /Users/foo/Library/Postgresql/9.1/bin/ -B /Applications/Postgres.app/Contents/MacOS/bin/ -d /Users/foo/Library/Application\ Support/Postgres/var-9.1/ -D /Users/foo/Library/Application\ Support/Postgres/var
我得到的错误:
lc_collate cluster values do not match: old "en_US",new "en_US.UTF-8"
我该如何纠正?
注意:我曾经让Postgres.app运行9.1,但我覆盖了它.我应该阅读/遵循的指示是:Upgrading Postgres.app.所以旧的bin已经消失,但我仍然有数据目录.相反,我下载了Postgres 9.1并将其安装在别处以使用bin目录升级并将我的数据移动到新的Postgres.
从
http://www.postgresql.org/docs/9.0/static/pgupgrade.html
Initialize the new Postgresql cluster
Initialize the new cluster using initdb. Again,use compatible initdb
flags that match the old cluster. Many prebuilt installers do this
step automatically. There is no need to start the new cluster.
当你运行initdb时,请确保–lc-collate = locale与旧的db相同,例如“en_us”