情况如下:
我使用以下命令安装了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 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我曾经尝试删除"everything",然后重新安装它们,现在我得到了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:sudo apt-get install postgres-xc
有没有其他启动服务器的方法?我应该按照建议安装postgres-xc吗?
谢谢
发布于 2014-07-15 01:01:02
您的机器上安装了旧的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-common和postgresql-client-common,这有助于实现这一点。
https://stackoverflow.com/questions/24741230
复制相似问题