Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed PostgreSQL 9.1 and 9.2 on my Ubuntu machine. The postgresql service starts both versions:

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

I'd like to start just 9.2 server but without uninstalling 9.1, is that possible?

share|improve this question
up vote 4 down vote accepted

Short version:
Replace auto with manual in /etc/postgresql/9.1/main/start.conf

Long version:

Each PostgreSQL cluster in Debian/Ubuntu has a start.conf file that controls what /etc/init.d/postgresql should do.

This is documented with pg_createcluster:

   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:

       The postmaster process is started/stopped automatically in the init
       script.  This is also the default if the file is missing.

       The postmaster process is not handled by the init script, but
       manually controlling the cluster with pg_ctlcluster(1) is

       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.
share|improve this answer
Actually it should be 'disabled', not 'disable' - so says the start.conf file itself. Should I start the server some other way that 'sudo service postgresql start'? cause this way the manual/disabled cluster still starts :/ – Bartlomiej Skwira Sep 28 '13 at 19:00
@BartlomiejSkwira: manual worked for me when I had to use it (no auto-start). About disable or disabled, the startup shell script (see /usr/share/postgresql-common/init.d-functions) doesn't really care, if it's not auto it doesn't start. – Daniel Vérité Sep 28 '13 at 19:43
According to the source /usr/share/postgresql-common/ it's also spelled disabled so the manpage is indeed wrong. – Daniel Vérité Sep 28 '13 at 19:49

Rename /etc/postgresql/9.1/main/posgtgresql.conf to something else, or move the entire /etc/postgresql/9.1 directory somewhere else.

The start scripts key off of the directories that exist in /etc/postgresql/ that have */postgresql.conf in them.

share|improve this answer
Renaming or even moving postgresql.conf and start.conf isn't enough and the server still starts. Moving the dir works, but seems more like a bad workaround. – Bartlomiej Skwira Sep 28 '13 at 17:53
It won't start w/o a postgresql.conf... it'll SAY it does, because the startup scripts on ubuntu are horrible about giving any sort of useful output about what is going on, but the server doesn't start:((( for c in /etc/postgresql/"$2"/*; do [ -e "$c/postgresql.conf" ] || continue )))(read: no error output) Moving the entire directory removes the configuration from the startup script detection completely and then it shouldn't mention it. – jerm Sep 28 '13 at 18:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.