How to run 2+ versions of PostgreSQL concurrently

Поиск
Список
Период
Сортировка
Искать

How to run 2+ versions of PostgreSQL concurrently

От:
Michael Glaesemann <grzm@myrealbox.com>
Дата:
I'm looking forward to installing 7.4 on my computer, and I'd like to 
do so without displacing my current 7.3.2 installation. I've been 
looking through the documention as to how to do this, and would like to 
hear some feedback on my plan before I implement it.

I'm sure others already do something like this, and that there's 
probably information about how to do this out there. If you'd point me 
in the right direction, I'll gladly follow the link.

7.3.2 is currently installed in /usr/local/pgsql (the default 
location). I'd like to install 7.4 in a directory on a different volume 
that I've made a symlink to, accessible from /usr/local/pgsql2.

During configuration, I need to set the directory and port (besides 
other, unrelated flags), using
--prefix=/usr/local/pgsql2 --with-pgport=5433

When initializing the database cluster, I need to create an 
environmental variable (such as PGDATA2) set to the directory where the 
data will be stored.

One thing I'm concerned about is psql and other shell commands. I'm 
assuming things have (or could possibly have) changed between 7.3.2 and 
7.4 and I need to make sure the each psql works with its corresponding 
database cluster. I'm also wondering how I differentiate between the 
two postmasters.

Thanks in advance for any advice or pointers!

Michael

Re: How to run 2+ versions of PostgreSQL concurrently

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Michael Glaesemann  writes:
> [about a second installation on an existing machine]
> When initializing the database cluster, I need to create an 
> environmental variable (such as PGDATA2) set to the directory where the 
> data will be stored.

No, you'd just set PGDATA.

Joe Conway just posted some cleaned-up scripts for working with multiple
installations on-the-fly:
http://archives.postgresql.org/pgsql-patches/2003-11/msg00318.php
This might be overkill for your needs, but I can attest that it covers
all the essential bases.

			regards, tom lane
FAQ