簡體   English   中英

PostgreSQL版本不兼容

[英]PostgreSQL version incompability

情況如下:

我已經用命令安裝了postgresql-9.3

    sudo apt-get install postgresql-9.3:

然后使用pg_ctl啟動服務器

    pg_ctl -D /var/lib/postgresql/9.3/main -Z coordinator start

導致以下錯誤:

    18:23:50 CEST FATAL:  database files are incompatible with server 2014-07-14 18:23:50 CEST DETAIL:  The data directory was initialized by PostgreSQL version 9.3, which is not compatible with this version 9.2.4.

我不知道9.2.4版本在哪里,我已經檢查了有關Postgres的所有文件夾,它們都位於9.3文件夾下,甚至嘗試了pg_clusters 任何人都可以提供一些提示來解決此問題嗎?

dpkg -l | grep dpkg -l | grep postgres給出結果:

ii  postgres-xc               1.1-2ubuntu2  amd64        write-scalable, synchronous multi-master, transparent PostgreSQL cluster
ii  postgres-xc-client        1.1-2ubuntu2  amd64        front-end programs for Postgres-XC
rc  postgresql-9.3            9.3.4-1       amd64        object-relational SQL database, version 9.3 server
rc  postgresql-client-common  154           all          manager for multiple PostgreSQL client versions
rc  postgresql-common         154           all          PostgreSQL database-cluster manager

我曾經嘗試刪除“一切”,然后再次重新安裝它們,現在我有了dpkg -l |的輸出。 grep` postgres:

    ii  postgresql-9.3        9.3.4-1       amd64        object-relational SQL database, version 9.3 server
    ii  postgresql-client-9.3 9.3.4-1       amd64        front-end programs for PostgreSQL 9.3
    ii  postgresql-client-common  154       all          manager for multiple PostgreSQL client versions
    ii  postgresql-common         154       all          PostgreSQL database-cluster manager

現在一切看起來都很好,當我嘗試使用pg_ctl啟動服務器時,命令行告訴我:

    The program 'pg_ctl' is currently not installed. You can install it by typing:

須藤apt-get install postgres-xc

還有其他啟動服務器的方法嗎? 我應該按照建議安裝postgres-xc嗎?

謝謝

您的計算機上安裝了舊的Postgres 9.2(除非您不混淆兩台計算機)。 假設Debian缺乏信息。 Ubuntu應該是相似的。

檢查與

dpkg -l | grep postgres

(除非您也沒有安裝程序包管理器來安裝程序,否則您也應該能夠解決此問題。)

如果您不再需要Postgres 9.2(請確保這樣做!)將其卸載。 然后一切都會正常。

sudo apt-get remove postgresql-9.2

甚至:

sudo apt-get purge postgresql-9.2

如果要同時保持兩個(或多個)版本,建議您另外安裝postgresql-commonpostgresql-client-common ,這有助於實現這一點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM