Darcy Buskermolen darcy
Thu Aug 26 20:47:45 PDT 2004
On August 26, 2004 01:37 pm, joe wrote:
> Hi all,
>         I am testing Slony-I before (hopefully) using it to build a
> simple master-slave cluster to run our website.  In the documentation
> and through various googles I have found that slony doesn't
> automagically replicate schema changes.  That by itself is not an issue
> for me since schema changes don't happen all that often to the website,
> but when they do happen it would be nice to know what the proper
> sequence of events need to take place to ensure that slony function
> properly after, and I haven't been able to determine that sequence of
> events is.
>         I have done some playing with the pg_bench db as setup in the
> examples, and what I have found is this:
>         1. Alter tables don't seem to require any interaction with
> slonik to be replicated, as long as the alter table statement(s) is/are
> executed on all nodes before any queries (inserts, updates, deletes)
> that use the new schema are run.  This doesn't feel quite safe (or sane)
> to me and I was wondering how other people handle modifications to
> existing tables.

You use the execute script directive 
http://gborg.postgresql.org/project/slony1/genpage.php?slonik_commands#stmt_ddl_script 
in slonik to accomplish this.
(We should probably add a how-to/example of this in action.. I'll look into 
this mid september if soemone hasn't beaten me too it) 

>         2. adding new tables to an existing replication set (apparantly)
> requires unsubscribing that set, adding the table then re-subscribing
> the set. This forces a full dump of the table (and possibly full set?)

This is done using merge set
http://gborg.postgresql.org/project/slony1/genpage.php?slonik_commands#stmt_merge_set
in slonik.
(once again more examples of this in practice is probably not a bad thing)

> when it happens. (Not fun when the table/set is several gigs). Do most
> people just make a new table set when they add tables to the
> source/master node or how do they deal with that situation?

-- 
Darcy Buskermolen
Wavefire Technologies Corp.
ph: 250.717.0200
fx:  250.763.1759
http://www.wavefire.com


More information about the Slony1-general mailing list