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 postgresql 9.1 installed on my machine (Ubuntu). I need another postgresql server that would run next to the old one. Exact version does not matter, but I'm thinking of using 9.2 version. How could I properly install and run another postgresql version without screwing old one (like upgrading). So those versions would run independently on different ports. Old one on 5432 and new one on 5433 for example.

The reason I need this is for two OpenERP versions databases. If I run two OpenERP servers (with different versions) on single postgresql port, it crashes because new OpenERP version detects old versions database and tries to run it, but it crashes because it uses another schemes.

P.S or maybe I could just run same postgresql server on two ports?

Update So far I tried this:

/usr/lib/postgresql/9.1/bin/pg_ctl initdb -D main2

It created new cluster. I changed port to 5433 in new clusters directory postgresql.conf file. Then ran this:

/usr/lib/postgresql/9.1/bin/pg_ctl -D main2 -l logfile start

I got response server starting. But when I tried to enter new cluster's template database with: psql template1 -p 5433

I got this error:

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"?

Also now when I try to stop server with:

/usr/lib/postgresql/9.1/bin/pg_ctl -D main2 -l logfile start

I get this error:

pg_ctl: PID file "main2/" does not exist
Is server running?

So I don't understand if server is running and what I'm missing here?


Found what was wrong. Stupid me. I didn't notice that when I changed port in .conf file, that line was commented already. So actually I didn't change anything first time, but thought I did and it used default 5432 port.

share|improve this question
See related post – Craig Ringer Jun 6 '14 at 9:27
@CraigRinger thats my post.. And yes it is related in context, but not the actual problem. – Andrius Jun 6 '14 at 9:39
Yeah, just making sure others can find it because it's related. I should've said, sorry. – Craig Ringer Jun 6 '14 at 12:45

You must log in to answer this question.

Browse other questions tagged .