Ow Mun Heng Ow.Mun.Heng at wdc.com
Sun Sep 7 21:04:42 PDT 2008
On Thu, 2008-08-28 at 12:03 -0400, Christopher Browne wrote:
> Ow Mun Heng <Ow.Mun.Heng at wdc.com> writes:
> 
> > Considering doing partitioning/table inheritance on a master/slave Db
> > replicated by slony.
> >
> > I'm not sure how it handles the table inheritance. 
> > Do I need to manually add the tables to be inherited? what about
> > removing it from inheritance?
> > Is there an automated way? 
> >
> > Can anyone shed some light into how slony deals with this?
> 
> There is a test in the test suite that uses inheritance-based partitioning:
>   http://main.slony.info/viewcvs/viewvc.cgi/slony1-engine/tests/testpartition/?pathrev=REL_1_2_STABLE
> 
> It sets up 3 monthly partitions, and adds them to replication.
> 
> There are stored procedures in version 1.2 for this:
> 
>   add_empty_table_to_replication()
>     which adds an empty table to a replication set (this is a general "tool")
>   replicate_partition()
>     which uses the above function to replicate an inherited partition, validating
>     that it is a child of a replicated parent table
> 
> You can run replicate_partition() (passing in the appropriate
> parameters) in a Slonik script; this will add a fresh, empty partition
> to replication, in the same replication set as its parent.

Thanks for the information. I guess I need to do some testing to see
exactly how it works.
But, noting the above, is it as easy as running slonik and passing

replicate_partition('child_200901')


I"m planning to replicate a whole host of partitions (~20) and will add
one each week.



More information about the Slony1-general mailing list