Re: Run 2 versions of Postgresql on one machine? - Mailing list pgsql-general
From | Wei Wang |
---|---|
Subject | Re: Run 2 versions of Postgresql on one machine? |
Date | |
Msg-id | 005301c3ecdd$fb7d3440$e164e880@weiwang Whole thread Raw |
In response to | Re: Run 2 versions of Postgresql on one machine? ("Peter Alberer" <h9351252@obelix.wu-wien.ac.at>) |
Responses |
Re: Run 2 versions of Postgresql on one machine?
Re: Run 2 versions of Postgresql on one machine? Re: Run 2 versions of Postgresql on one machine? |
List | pgsql-general |
Thank you all for your kind help. I have set up 7.4.1 and it's up and running perfectly. One small question that might not belong in this mailing list: Since all the binary commands share the same name, e.g. initdb, createdb, psql, etc, and the default path is already the 7.1.3 version. How do I come up a way to access binary commands of both versions quickly without adding absolute path infront of those of 7.4.1? Many thanks, Wei ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us> To: "Peter Alberer" <h9351252@obelix.wu-wien.ac.at> Cc: "'Wei Wang'" <ww220@cam.ac.uk>; <pgsql-general@postgresql.org> Sent: Friday, February 06, 2004 5:04 PM Subject: Re: [GENERAL] Run 2 versions of Postgresql on one machine? > "Peter Alberer" <h9351252@obelix.wu-wien.ac.at> writes: > > it is quite easy to have two different version of postgres running on > > one machine. You need 2 different directories for the data files and 2 > > different ports for the 2 postmasters to listen. > > > -first you prepare the data directories with initdb, you can use the -D > > parameter to give the location of the files. > > -then start the database (postmaster) with parameter -p PORTNUMBER. > > Default port is 5432 so your existing postmaster process will probably > > listen there. The new version should listen on another port. All of the > > other Postgres utilities (pgsql, createdb, ...) also need the -p > > PORTNUMBER info as well, so they can connect to the right postmaster > > process. > > You will also need to make sure that the executables and library files > get installed into different places, else one version will overwrite the > other at install time. I am not sure how to do that with an RPM-based > installation, but it is quite easy if you are building from source: > just supply a --prefix option to "configure". Perhaps > > ./configure --prefix=/usr/local/pgsql735 > > to install everything under /usr/local/pgsql735 (executables in > /usr/local/pgsql735/bin, etc). > > Another thing you can do when building from source is to give each > version a different default port number: > > ./configure --prefix=/usr/local/pgsql735 --with-pgport=5735 > > This is pretty handy because the created postmaster, psql, and other > utilities will automatically use the right port number for their > version, and you don't have to fool around with setting it as Peter > mentions above. All that you have to do is adjust your PATH to find > the psql you want to use at the moment. > > BTW, there is nothing that says you need to install under /usr. If you > are just testing, it is perfectly possible to build, install, and create > the data directory in directories under your own home directory, and > then manually start the postmaster running as yourself. This wouldn't > be good when you want the postmaster auto-started at system boot, but > for a temporary testing setup it's cool --- you do not need root > privileges at all when doing it this way. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html
pgsql-general by date: