Super User is a question and answer site for computer enthusiasts and power users. 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 8.4 and 9.1 on same Ubuntu machine and I want to try to run only 9.1 and 8.4 to stay off. When I run /etc/init.d/postgresql start it starts both. How to start only one version, in this case 9.1 ?

Ubuntu is upgraded to 12.04, bott are installed via apt-get install but I added to sources list for 9.1 and then update and apt-get install.

There is no /etc/init.d/postgresql-9.1 start

share|improve this question
What version of Ubuntu and how did you install 9.1 ? Why not simply remove 8.4 ? – bodhi.zazen Jan 29 '14 at 16:56
@bodhi.zazen I have edited – Damir Jan 29 '14 at 16:58
What sources and what makes you think 8.4 is installed let alone running ? error message ? – bodhi.zazen Jan 29 '14 at 17:04
@bodhi.zazen When run /etc/init.d/postgresql start it writes starting 8.4 and after starting stating 9.1 and after when I run netstat -ltnp for port 5432 I got 8.4 – Damir Jan 29 '14 at 17:10
I suggest you remove postgresql 8.4 . – bodhi.zazen Jan 29 '14 at 17:34

Edit /etc/postgresql/8.4/main/start.conf and change auto to manual.

Or, if you no longer wish to keep the 8.4 database, pg_dropcluster it, or just uninstall 8.4.

For more information see

share|improve this answer

You can run /etc/init.d/postgresql start 9.1 to explicitly start just 9.1.

I figured this out by looking at the startup script. In /etc/init.d/postgresql you'll see something like

# versions can be specified explicitly
if [ -n "$2" ]; then
    versions="$2 $3 $4 $5 $6 $7 $8 $9"

$2 in bash means the second argument to the script, thus.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .