PDA

View Full Version : [ubuntu] multiple instance of postgres on the same machine


detorresrc
March 16th, 2010, 11:15 PM
Hi,

Please help me how to setup multiple instance of postgre server on the same machine.

Thanks

KB1JWQ
March 16th, 2010, 11:29 PM
Big trick is to bind it to an alternate port and use alternate data directories, after that it's smooth sailing.

May I ask why you're doing this? Most of the time this is ill advised.

detorresrc
March 16th, 2010, 11:44 PM
Im doing this becauze i need two postgreSQL server, but i dont have any unit to install another one. Thats why i need to install it on the same machine. Do you have a manual or link how i can i do it?

KB1JWQ
March 16th, 2010, 11:59 PM
Very, very, very few applications will require an entirely seperate server. Most will require a new database, which can easily be done within one running instance-- but we'll assume you know what you're talking about.
Copy the intiscript to be called something like postgres2; edit it so that it pulls from a second configuration file. Copy /etc/postgres.conf to that second location, and tweak the data directory and port assignments. Boom, done.

detorresrc
March 17th, 2010, 12:14 AM
Thanks for the info. God Bless :)