Rod Taylor pg
Tue May 2 07:14:45 PDT 2006
On Tue, 2006-05-02 at 09:39 -0400, Jan Wieck wrote:
> clue when that even might happen. The only way to do it is to split the 
> whole work into two slonik scripts and wait with other mechanisms until 
> the newly subscribed tables actually appear in the subscribers sl_table 
> config.

That's what I ended up doing. One shell script watches the master and
creates new sets to be replicated and merged (keeps about 5 in the queue
at all times). Another script watches for copied sets and merges them
into the main set.

I keep 5 ahead for the transaction IDs without huge slony transactions.

> For some reason almost everyone trying to add new tables stumbles over 
> that problem. I presume our documentation is lacking here.

Perhaps it would be worth adding a mechanism to detect a subscribe_set
and merge_set (same ID) in the same script and throw an error?


> On 4/28/2006 6:29 PM, Melvin Davidson wrote:
> >>
> >>    try {
> >>      create set (id = 999, origin = 1, comment = 'merge set');
> >>      set add table (set id = 999, origin = 1, id = 999, fully qualified
> >>name = '$TAB');
> >>    }
> >>    wait for event( origin = all, confirmed = all, wait on = 1, timeout
> >>= 0);
> >>    echo 'Added $TAB to temporary set';
> >>
> >>    subscribe set (id = 999, provider = 1, receiver = 2, forward = no);
> >>    wait for event( origin = all, confirmed = all, wait on = 1, timeout
> >>= 0);
> >>    echo 'Subscribed $TAB';
> >>
> >>    merge set (id = 667, add id = 999, origin = 1);
> >>    wait for event( origin = all, confirmed = all, wait on = 1, timeout
> >>= 0);
> >>    echo 'Merged $TAB';
> > 
> > If you are going to use a variable for a table name, _do not_ enclose it in quotes.
> > In your case, slony is now looking for a table named $TAB.
> > 
> > The correct statement should be
> > set add table (set id = 999, origin = 1, id = 999, fully qualified name = $TAB);
> > 
> > Good luck, and may the bytes be with you. 
> > 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Slony1-general mailing list
> > Slony1-general at gborg.postgresql.org
> > http://gborg.postgresql.org/mailman/listinfo/slony1-general
> 
> 
-- 




More information about the Slony1-general mailing list