Christopher Browne cbbrowne at afilias.info
Wed Feb 22 08:32:02 PST 2012
On Wed, Feb 22, 2012 at 7:05 AM, Ger Timmens <Ger.Timmens at adyen.com> wrote:
> We were wondering if it will be possible  in future versions of slony to
> replicate
> depending on the contents of some fields in a table record.
> So in our current implemenation we have
>
> table SomeTable ( name varchar, ......);
>
> on the master. This table is succesfully replicated to several slaves
> (slave1, slave2, ......).
>
> What we would like is depending on the value of 'name', replicate the
> record,
> to e.g.
>
> slave1 if (name like 'a%'),
> slave2 if (name like 'b%),

Changes committed into master in the last week provide the
underpinnings to make it a lot easier to implement this sort of thing
in the future.

The format of log records have changed, so that instead of the log
table capturing literal portions of SQL statements, it captures an
array indicating the data.

This means that, in the next version of Slony, splitting apart the log
data to perform special logic based on the data no longer requires
parsing SQL, instead, data can be accessed more directly from the
array.

This isn't particularly well documented at this point, which is
something I probably ought to add to my ToDo list to rectify.

It's plausible that in a subsequent version of Slony, we'll introduce
some sort of "hook" to provide an intentional way of injecting the
sort of logic that you're talking about.

"Plausible" here means that since nobody has thought very hard about
it, nobody has arrived at any particularly elegant way to fit it in.
I'd think it desirable to NOT add a hook until there's an idea of how
to do it well.  Of course, once someone arrives at a reasonably
elegant way of describing the plumbing, it's entirely possible that
this would prove pretty easy to implement.


More information about the Slony1-general mailing list