Setting up Slony on Windows
May 13th, 2008 By: jamesThis isn’t intended to be a complete tutorial, but for those of us who have previously only run Slony on Linux, this might be a helpful post.
Install Slony
Configure pgAdmin file/options and set the slony path
G:\Program Files (x86)\PostgreSQL\8.2\share
Create the master db
create the slave db
Initialize the master database. From the command line
pgbench.exe -U postgres -i pb
copy the master to the slave: from command line
pg_dump.exe -U postgres -h localhost pb |psql =U postgres -h localhost pbslave
Add a new cluster on the master
Add a node on the slave db
Add a path on both the master to the slave
host=localhost port=5432 dbname=pbslave user=postgres password=a
Add a path on the slave to the master
host=localhost port=5432 dbname=pb user=postgres password=a
Add a replication set on the master
Add accounts, branches, tellers
From the master Subscribe the slave
from the all tables set, right click subscribe set
Slony is configured, now we have to make windows start the engines correctly.
Create two text files in c:\slony
master.conf and slave.conf which look like this:
cluster_name='pgbench'
conn_info='dbname=pgbench user=postgres password=a'
From the command line register the engines
slon -addengine slony g:\slony\slave.conf
lon -addengine slony g:\slony\master.conf
if this hasn’t been done register slony as a service
slon -regservice slony
go to services and start slony
check event log for errors
if there are none then run a test from the master:
insert into accounts values (100001, 1, 0, 'test');
from the slave
select count(*) from accounts;







Moki Systems is seeking a full-time Ruby on Rails developer. The person should be a self starter, willing and able to figure things out on their own. Applicant should have experience with Ruby on Rails, MVC programming concepts, MySQL and/or PostgreSQL experience and the ability to learn new technologies. Any additional...
November 12th, 2009 at 3:08 am
Images of this post are not available and i really need them..can you fix them?
Thanks in advance,
Greggio Andrea.