Home > Archive > Slony1 PostgreSQL Replication > July 2005 > Re: How can we replicate data of master table to









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How can we replicate data of master table to
Scott Marlowe

2005-07-08, 11:24 am

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.
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com