Thread: *** How can I install two postgresqls in the same machine? *****

*** How can I install two postgresqls in the same machine? *****

From
"kitaeda"
Date:
I want to install two postgresqls in the same machine.
How can I do so?
What do I have to specific configure options?




Re: *** How can I install two postgresqls in the same machine? *****

From
Thomas Mack
Date:
Am Freitag, 14. Juli 2006 08:36 schrieb kitaeda:
> I want to install two postgresqls in the same machine.
> How can I do so?
> What do I have to specific configure options?
>
You have to have them in different locations obviously, so you might
use a different --prefix=... for both on configure. And you have to
run them on a different port. This works for us back since a 6.5
version of postgres.

Thomas Mack
TU Braunschweig, Institut für Informationssysteme




Re: *** How can I install two postgresqls in the same machine? *****

From
"Spiegelberg, Greg"
Date:
We have done this here and it works well.  In our case we have two
different rev's of PostgreSQL which we install as /path/to/pgsql-7.4.6
and /path/to/pgsql-8.1.3 but reference using links /path/to/pgsql-7.4
and /path/to/pgsql-8.1.  Reason is you don't want to muck with your path
every time you upgrade and going from 7.4.x to 7.4.y or 8.1.x to 8.1.y
is seamless.

We also use different accounts for each database.  Each user account
owns the PGDATA dir which also prevents corruption caused by confusion.
DB user starts database A but mistakenly starts B which is already
running.  Different users prevents that.

Different ports are necessary or at least different IP's.  Linux you'd
have eth0 as 10.1.1.1 and on same machine make a eth0:2 be 10.1.1.2.
Each postgres would bind to 5432 but on a different interface.

You'll need a different place for the socket.  We've put them in the db
user home dir b/c you can't seem to get away from it and we don't use it
anyways.

Also visit the /etc/sysctl.conf or OS equivalent if you're not using
Linux and bump up the appropriate  shared memory (typically
kernel.shmmax, kernel.shmall, kernel.shmmni) and semaphore (kernel.sem)
tunables.

Depending on disk and the nature of your database you'll need to
eventually think about what database lives on what disk or perhaps
placing the pg_xlog somewhere other than the default.

We've also wrapped the psql command with our own script which takes a
database name as a parameter, determines what IP & port to connect to
and also determines the version of postgres running so the proper psql
client is invoked.  I don't know if it's a must but you'll be warned if
you try to connect to a 8.1 using a 7.4 client.

That's all I can think of now.

Anyone else?

Greg


> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of kitaeda
> Sent: Friday, July 14, 2006 2:37 AM
> To: pgsql-admin@postgresql.org
> Subject: [ADMIN] *** How can I install two postgresqls in the
> same machine? *****
>
> I want to install two postgresqls in the same machine.
> How can I do so?
> What do I have to specific configure options?
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>

Re: *** How can I install two postgresqls in the same machine? *****

From
"Aaron Bono"
Date:
On 7/14/06, Spiegelberg, Greg <gspiegelberg@cranel.com> wrote:

We've also wrapped the psql command with our own script which takes a
database name as a parameter, determines what IP & port to connect to
and also determines the version of postgres running so the proper psql
client is invoked.  I don't know if it's a must but you'll be warned if
you try to connect to a 8.1 using a 7.4 client.

 
Care to share that script or at least show us how it works?  This sounds like a great way to gradually upgrade applications to new database versions, especially when you have many clients on a machine and upgrade only some of them at a time.

Thanks!
Aaron

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
==================================================================