2017-04-14 4 views
0

私のマシンでpostgresを使用しようとしていて、しばらく前にbrew install postgresを実行してError: postgresql-9.4.5_2 already installedを実行した後にデータベースソフトウェアをインストールしたことに気付きました。そこから私は、バックグラウンドでのpostgresを実行することと、正常に起動するhomebrew/servicesをインストールすることにしました。しかしPostgres - 自家製インストールでサーバファイルが見つかりません複数のバージョン

brew services start postgresql==> Successfully startedのpostgresql (label: homebrew.mxcl.postgresql)

でバックグラウンドジョブを閉じて、私はpostgresを実行したときに、私はのエラー受信:

LOG: skipping missing configuration file "/usr/local/var/postgres/postgresql.auto.conf" 
FATAL: database files are incompatible with server 
DETAIL: The data directory was initialized by PostgreSQL version 9.3, which is not compatible with this version 9.4.5. 
:私はSOの答えを踏襲すると
postgres does not know where to find the server configuration file. 
You must specify the --config-file or -D invocation option or set the PGDATA environment variable. 

は、cat /usr/local/var/postgres/server.logは、私は次のエラーを受け取りました

私はPostgreSQLの古いバージョンをインストールして、削除する必要があると思います。

私はその後psqlを試してみましたが、受け取っ:

psql: could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 

そして最後には、元のメッセージ次およびenv varibleの設定をもたらした、initdb /usr/local/var/postgresで新しいDBを初期化するが、それはそれを修正していないことを決めました。 export PGDATA=/usr/local/var/postgres。再びpostgresを試みた後、私はこれが私に語ったことは、私はpostgresサーバを起動するために解決する必要がバージョンの互換性の問題は、明らかにあるということですが、私はどのようなファイルのパスはよく分からない

LOG: skipping missing configuration file "/usr/local/var/postgres/postgresql.auto.conf" 
FATAL: database files are incompatible with server 
DETAIL: The data directory was initialized by PostgreSQL version 9.3, which is not compatible with this version 9.4.5. 

を受け取りますそれをクリアするための適切な方法が必要です。誰かが何かガイダンスを提供できますか?

答えて

0

私は同じ問題を抱えていたし、私はそれを実行することによって動作するようになった:

pg_ctl -D /usr/local/var/postgres start && brew services start postgresql

this guideが良かったです)。

関連する問題