Re: Running multiple versions

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Nishad Prakash <prakashn(at)uci(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Running multiple versions
Date: 2012-01-06 05:03:01
Message-ID: CAOR=d=0it+-o6V+wORncxrzNr+-xWEMG5b4WbPXb7c8NR+b24w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 5, 2012 at 9:48 PM, Nishad Prakash <prakashn(at)uci(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Keller 2012-01-06 06:12:07 Re: Vacuum and Large Objects
Previous Message Demitri Muna 2012-01-06 04:56:22 Re: Radial searches of cartesian points?