<div dir="ltr"><div>Is there a recommended way to get cascading replication set up from database A to database B to database C? I've tried three ways, two of which worked, but none of which feels like the "right" way.</div><div><br></div><div>1) I tried following the steps at <a href="https://bucardo.org/Bucardo/operations/makedelta">https://bucardo.org/Bucardo/operations/makedelta</a>, but the technique described on that page doesn't seem to have worked since about 2011.</div><div><br></div><div>2) I set up two completely separate bucardo runs, one from A -> B and one from B->C. Separate bucardo databases, separate daemons, separate piddirs, separate logs, separate everything. </div><div><br></div><div>I enabled makedelta on B.</div><div><br></div><div>This worked except for notifying the B->C sync of the change, so I set the kick trigger on the tables on database B to ENABLE ALWAYS. Then I had cascading replication.</div><div><br></div><div>3) I set up one bucardo run with two syncs, one from A->B and one from B->C. Again, I enabled makedelta on B.</div><div><br></div><div>Because the syncs were on different databases, I was unable to create the second herd. I got an error about all the tables in a relgroup needing to be from the same database.</div><div><br></div><div>I tracked the cause of this down to the herdcheck trigger function. By changing the logic in that function, I was able to get the herd created. The original herdcheck logic looks like this:</div><div><br></div><div><i>-- All goats in a herd must be from the same database<br>PERFORM herd FROM herdmap h, goat g WHERE h.goat=<a href="http://g.id">g.id</a> GROUP BY 1 HAVING COUNT(DISTINCT db) > 1;<br><br>IF FOUND THEN<br>RAISE EXCEPTION 'All tables must within a relgroup must be from the same database';<br>END IF;<br></i></div><div><br></div><div><i>RETURN NEW;</i></div><div><i><br></i></div><div>I replaced</div><div><i>RAISE EXCEPTION 'All tables must within a relgroup must be from the same database';<br></i></div><div><br></div><div>with </div><div><br></div><div><i>RETURN NULL;</i></div><div><i><br></i></div><div>And then it simply didn't insert the rows that would violate the condition. And then cascading replication worked.</div><div><br></div><div>But both solutions (2) and (3) feel like I'm working against Bucardo instead of with it. There might also be consequences that I'm not aware of. Is there a "Bucardo" way to do what I want?</div><div><br></div><div>Thanks,</div><div>Sherrylyn</div></div>