Christopher Browne cbbrowne
Mon Jul 19 03:57:18 PDT 2004
Thomas F.O'Connell said:
> In looking through the slonik commands, I don't see anything that can
> let you add tables for replication in bulk. I've got a database with
> thousands of relations, and it's looking like I'm going to have to
> write a meta-slonik script that builds a slonik script that adds all
> the tables I want to replicate. Is that correct, or is there some way
> of using slonik to say "replicate an entire database"?
>
> As far as future development of Slony is concerned, what actually
> parses slonik, and will there be any kind of developers guide for
> extending it?

I have a set of Perl scripts for controlling a cluster that I'll be
checking in Real Soon Now.

Unlike the monolithic script that is in the distribution now that asks all
sorts of questions, my toolset grabs cluster config from a config file,
and then has a script for each of a variety of major actions you'd want to
invoke on the cluster.  It doesn't yet include scripts for shifting the
origin; that will presumably come soon enough...

One of the assumptions is that there will be, available, a list of all of
the relevant relations that are to be replicated.

I don't see any way to generalize that in any "vast" way.  My assumption
is that the lists exist as the following sets:

 - A list of tables that have primary key candidates;

 - A list of tables for which Slony-I will need to add a primary key
candidate;

 - A list of sequences that are to be replicated.

Stick those three things in a config file, and it's dead easy to generate
a suitable "create set" that first adds PK candidates and then builds the
set of all the tables.

If you have thousands of relations, you'll probably need to build queries
to look for them.  At that point, throwing them into a file should be no
big deal.

I would be reluctant to add functionality to try to do that automagically;
the more sophisticated scripts get, the more their actions resemble
magick, and the more difficult it is to convince a DBA to trust them :-(.

That strikes me as being a problem with the present "monolithic Perl
script;" it's a bit too big and hairy for me to trust it.
-- 
(reverse (concatenate 'string "ofni.sailifa@" "enworbbc"))
<http://dev6.int.libertyrms.info/>
Christopher Browne
(416) 646 3304 x4124 (land)


More information about the Slony1-general mailing list