自作を使用してPostgresをインストールおよびアップグレードしたと仮定すると、次の手順を実行できます。
-
現在のPostgresサーバーを停止します:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist -
新しい10.1データベースを初期化します:
initdb /usr/local/var/postgres10.1 -E utf8 -
pg_upgradeを実行します (注:以下以外からアップグレードする場合は、ビンのバージョンを変更してください) :pg_upgrade -v \ -d /usr/local/var/postgres \ -D /usr/local/var/postgres10.1 \ -b /usr/local/Cellar/postgresql/9.6.5/bin/ \ -B /usr/local/Cellar/postgresql/10.1/bin/-v詳細な内部ロギングを有効にするには-d古いデータベースクラスタ構成ディレクトリ-D新しいデータベースクラスタ構成ディレクトリ-b古いPostgreSQL実行可能ディレクトリ-B新しいPostgreSQL実行可能ディレクトリ -
新しいデータを所定の場所に移動します:
cd /usr/local/var mv postgres postgres9.6 mv postgres10.1 postgres -
Postgresを再起動します:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist -
/usr/local/var/postgres/server.logを確認してください 詳細と、新しいサーバーが正しく起動したことを確認します。 -
最後に、レールを再インストールします
pg宝石gem uninstall pg gem install pg
PostgreSQLのドキュメントを読んで、フラストレーションを最小限に抑えるために上記の手順で何をしているのかを正確に理解することをお勧めします。