Re: Running multiple versions - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Running multiple versions
Date
Msg-id CAOR=d=0it+-o6V+wORncxrzNr+-xWEMG5b4WbPXb7c8NR+b24w@mail.gmail.com
Whole thread Raw
In response to Running multiple versions  (Nishad Prakash <prakashn@uci.edu>)
Responses Re: Running multiple versions
List pgsql-general
On Thu, Jan 5, 2012 at 9:48 PM, Nishad Prakash <prakashn@uci.edu> wrote:
>
> I'd like to keep my current installation (8.3.3) alive and running while
> installing and running 9.1.2 on the same server.  Can I do this using only
> the existing postgres superuser account?  I'd want to create two different
> initdb locations, and run the versions on different ports, of course, but it
> seems like the superuser's LD_LIBRARY_PATH would be an issue.  Whichever
> .../lib dir it points to, would be the only effective one, and the "other"
> version's programs wouldn't work.  Is there a way around this?  Or am I
> thinking about it all wrong?

So assuming all this is done in regular userland. built from source
etc, you'll need to do a couple things.  Each version needs to be
built with a different --prefix.  I prefer something like
--prefix=/home/myusername/pg83 and --prefix=/home/myusername/pg91 and
so on.  This will put the bin, lib etc stuff in your home dir.  Then
in order to do work in one setup or the other, make a you'll need to
set LD_LIBRARY_PATH and PGDATA accordingly for each instance.  It's
often easiest to just have a simple bash script you can run that sets
those so you can be one user or the other at the running of that
script.  so what might be in one would be something like:

# pg8.3.x stuff file:
export PGDATA /home/myuserdir/pg83/data
export PATH=/usr/bin:/home/myuserdir/pg83/bin
export LD_LIBRARY_PATH=/usr/bin:/home/myuserdir/pg83/lib

# pg9.1.x stuff file:
export PGDATA /home/myuserdir/pg91/data
export PATH=/usr/bin:/home/myuserdir/pg91/bin
export LD_LIBRARY_PATH=/usr/bin:/home/myuserdir/pg91/lib

So you'd ru one file or the other to run that database.

pgsql-general by date:

Previous
From: Demitri Muna
Date:
Subject: Re: Radial searches of cartesian points?
Next
From: Kevin Duffy
Date:
Subject: function return update count