我通过Homebrew安装了
postgresql.
升级后我有以下问题:
致命:数据库文件与服务器不兼容
详细信息:数据目录由Postgresql版本9.0初始化,与版本9.1.2不兼容.
$pg_upgrade -d /usr/local/var/postgres/ -D /usr/local/var/postgres -b /usr/local/Cellar/postgresql/9.0.4/bin -B /usr/local/Cellar/postgresql/9.1.2/bin
它没用.这是输出.
Performing Consistency Checks Checking current,bin,and data directories ok Checking cluster versions This utility can only upgrade to Postgresql version 9.1. Failure,exiting
错误.
对于我在OS X上使用Homebrew,就像这样.
>使用Homebrew安装新的postgres(开始收到错误)> mv /usr/local / var / postgres /usr/local/var/postgres.old> initdb -D /usr/local / var / postgres> pg_upgrade -b /usr/local/Cellar/postgresql/9.0.4/bin -B /usr/local/Cellar/postgresql/9.1.2/bin -d /usr/local/var/postgres.old -D / usr /本地的/ var / Postgres的> ./delete_old_cluster.sh(当您完成上述步骤时,将在当前目录中自动为您创建此脚本)> rm delete_old_cluster.sh