Forum OpenACS Q&A: Running postgres 7.1 and 7.2 on the same machine

Hi,

Last night while at IRC. Lars was in the same situation as me. Running 7.1 and 7.2 in the same box. So is DavB and Cathy. For what it worth my agreement with Cathy was to put out a short instruction on this and she will make it into a real doc.

Running postgres 7.1 and 7.2

  1. Unpack 7.2 targz
  2. configure it with ./configure prefix=/usr/local/pgsql72
  3. make... make install
  4. make sure your LD_LIBRARY_PATH and PATH is pointing to the correct version of postgres 7.2
  5. initdb -D /usr/local/pgsql72/data
  6. edit the data/postgresql.conf explicit define the port "port = 5433"
  7. run postgres 7.2
Aolserver pg driver
  1. unpack the driver
  2. edit the make file and make sure it uses /usr/local/pgsql72 path
  3. compile
  4. rename and copy over postgres72.so
  5. edit the config.tcl and use "localhost:5433:foo"
  6. make sure you load correctly the driver postgres72.so

In case you are like me and Lars who edited the RPM init.d postgres script. You can download the 7.1 and 7.2. You will need both.

postgresql - for 71 postgresql72 - for 72

Changes made are:

  1. /tmp lock file that is delete are /tmp/.s.PGSQL.5432 and /tmp/.s.PGSQL.5433 only.
  2. pid does not use pidof but a ps | grep | grep | awk
  3. /var/run and /var/lock lock files are changed
  4. uses the targz paths /usr/local/pgsql and /usr/local/pgsql72

Do NOT use this init.d scripts for initdb postgres. I did not change does. I just use this to start and stop postgres.

Take note the above are most from memory. Some maybe wrong so please test it before doing it in the production server. Also make sure to backup before doing it.

I'm having no problems using the same driver compiled against 7.1.3 with 7.2.1 as well.  Obviously not recommended practice in general but here it seems to be working fine...