如何禁用1版本的PostgreSQL服务器而不卸载它

我在Ubuntu机器上安装了PostgreSQL 9.19.2postgresql服务启动两个版本:

 $ sudo service postgresql start $ * Starting PostgreSQL 9.1 database server [ OK ] $ * Starting PostgreSQL 9.2 database server [ OK ] 

我想开始9.2服务器,但没有卸载9.1 ,这是可能的吗?

简短版本
/etc/postgresql/9.1/main/start.conf中将autoreplace为manual

长版本

Debian / Ubuntu中的每个PostgreSQL集群都有一个start.conf文件,用于控制/etc/init.d/postgresql应该执行的操作。

这是用pg_createclusterlogging的 :

  STARTUP CONTROL The start.conf file in the cluster configuration directory controls the start/stop behavior of that cluster's postmaster process. The file can contain comment lines (started with '#'), empty lines, and must have exactly one line with one of the following keywords: auto The postmaster process is started/stopped automatically in the init script. This is also the default if the file is missing. manual The postmaster process is not handled by the init script, but manually controlling the cluster with pg_ctlcluster(1) is permitted. disable Neither the init script nor pg_ctlcluster(1) are permitted to start/stop the cluster. Please be aware that this will not stop the cluster owner from calling lower level tools to control the postmaster process; this option is only meant to prevent accidents during maintenance, not more. 

将/etc/postgresql/9.1/main/posgtgresql.conf重命名为其他名称,或将整个/etc/postgresql/9.1目录移到其他位置。

启动脚本键入/ etc / postgresql /中存在* / postgresql.conf的目录。