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

前端之家收集整理的这篇文章主要介绍了如何禁用1版本的PostgreSQL服务器而不卸载它前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的Ubuntu机器上安装了Postgresql 9.1和9.2. postgresql服务启动两个版本:
$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中将auto替换为manual

长版:

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

这与pg_createcluster一起记录:

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.

猜你在找的Postgre SQL相关文章