Christopher Browne cbbrowne at ca.afilias.info
Fri Aug 20 08:20:26 PDT 2010
Henrik Nyström <byerley at spray.se> writes:
> I'm new to slony and have a need that I can't find answer to if it's possible.
>
> What I have is 3 databases for logs on different servers (for different
> products) where all databases and tables are named the same.
>
> Can I change the destination table name for replication with slony?
> In that the table "logs" are replicated to "logs_prodX" for each product
> database.
>
> from (server1) logdb.logs  to  logdb.logs_prod1
> from (server2) logdb.logs  to  logdb.logs_prod2
> from (server3) logdb.logs  to  logdb.logs_prod3
>
> If it's possible could you please point me in the right direction.

This is an idea about which developers have mused for some time now, but
it's not something that we've figured out how to implement.  

The name of the table is acquired from what is stored in sl_table on the
*provider* node.  Thus, if you fiddle with the contents of sl_table on
the provider, changing the table name (sl_table.tab_relname), then that
could do what you're looking for.

FYI, there's also a non-zero probability that I'm wrong there, and the
slon asks the *subscriber* for the table name.  If so, that's rather a
lot better, as it allows the cluster to remain comparatively stable in
the wake of this change.  Change the shape of the subscriptions and you
don't mess up that node 1 thinks it's "logdb.logs", node 2 thinks it's
"logdb.logs_prod1", and node 3 thinks it's "server1.logs_prod1".

How to configure it is the challenge, and how to manage name names
consistently if subscriptions get shifted around, is something nobody's
really figured out how to do.
-- 
select 'cbbrowne' || '@' || 'ca.afilias.info';
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list