Scott Marlowe smarlowe
Fri Jul 8 16:47:02 PDT 2005
On Fri, 2005-07-08 at 04:12, Ajay Dalvi wrote:
> Hi all,
> 
> One problem I am facing while using Slony 1.1.0 Replication.
> 
> If there are Some rows existing in slave server table which are
> altogether different from those rows in Master table.
> NOw when I subscribe slave for replication, what is happening is that
> all the previously existing rows of slave table are vanishing and only
> those rows which are replicated from Master table are gets saved in the
> slave table.

That's how Slony's replication is supposed to work.

> But I am having one scenario in which there are multiple sources ( we
> can say multiple masters)  from which I have to replicate data to one
> single destination ( we can say one slave).
> Of course I will have to create different sets for each Master, and will
> have to subscribe onle single slave to each set for replication.

> So how I will preserve the existing contents of Slave table after
> replication?

You don't.  What you do is set up an auxiliary table with that data in
it, set up the slave table, then create a unioned view on top of it. 
You can even make triggers to it appears your updating the "slave" table
but in fact those records are going into the updateable auxiliary table.

Replicate that back to the original source machine, and set up a unioned
view there, and you have a very poor man's two way replication.

It's up to you to test it, I've not set up something like that lately,
and certainly never in production.  But I imagine it could work.



More information about the Slony1-general mailing list