0

I'm trying to install a second instance of PostgreSQL on a server (Windows Server 2008) that already has it. I've managed to do this with different versions in the past, but in this case I want the second instance to be a hot-standby (read only replication) server for people to run reports from without affecting the production server with locks, etc. When I run the installer for version 9.2 it tells me that the database is already installed and offers to upgrade it.

Is it as simple as manually creating a duplicate Windows service entry to run that points to a different data directory? Or is this sort of behaviour not supported at all?

2 Answers2

0

if the goal is to have a dedicated box that runs several instances on postgres, on multiple tcp/ip ports, and it sounds like this is a virgin project,.... i would highly recommend installing a quality os on the box. centos or debian are great server linux distros, or you can always for with freebsd if you feel adventerous....

once you have that going, it becomes trivial to fire up multiple postgres instaces, each on its own tcp/ip port, with its own conf file, /tmp and /data dir's.

from my experience, doing this on *nix is very straightfowrward, but attempting on windows will drive one bonkers :P

nandoP
  • 2,021
  • 14
  • 15
  • It's not a virgin project, and we don't have any Linux servers in the business. If it was, we'd be using SQL Server where setting up multiple instances is also a doddle! – pete the pagan-gerbil Nov 24 '13 at 09:44
0

I've found the answer :)

The Postgres engine is already installed, all I needed to do was to set up a new managed Windows Service (easy with the command line tool sc) with the same executable path as the existing postgres service - just replacing the data directory parameter with a new data directory.

The new data directory is essentially a totally different instance of Postgres, and needs the Pogres.conf file editing to use a different port (and any other settings that might be relevant to point elsewhere). In my case, I also needed to turn off the WAL archiving and enable the hot standby settings.

It helped that in our setup, we have the application installed as per defaults in C:\Program Files but we keep our data directory on a separate disk.