<html><head></head><body><div style="font-family:bookman old style, new york, times, serif;font-size:medium;"><div style="font-family:bookman old style, new york, times, serif;font-size:medium;"><div style="font-family:bookman old style, new york, times, serif;font-size:medium;"><div style="font-family:bookman old style, new york, times, serif;font-size:medium;"><div>Hi Folks,</div><div><br></div><div>I have a question regarding the replication of tables between PostgreSQL 9.1 to PostgreSQL 9.5.</div><div><br></div><div>Is it possible to replicate tables of same name but with different schema names ?. I am trying to replicate <b>appl.</b>table(s) from PostgreSQL 9.1 to <b>user1.</b>table(s) of PostgreSQL 9.5 and all I could see is below</div><div><br></div><div><b><i>Could not find table "appl"."pgbench_accounts" on subscriber</i></b></div><div><br></div><div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">I have a set of tables under the "appl" schema in PG9.1 and the same tables have been created under the "user1" schema in PG9.5. I went through the documentation of "set add table" and came across a TABLES argument but even that uses the schema_name to qualify a table name.</span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">1) Is it a requirement for the tables to be created under same schema names ? or is there an alternative around it ? </span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">2) And, where is the step of "start of replication" supposed to be executed: at master or at slave ?. I inadvertently executed it on slave and the child process of slon deamon crashed and tried to come up every 10 seconds while there were messages in the slon redirection log that the child process was kill with 9 and trying to come up after 10 seconds.<br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">Please find below the commands that I have used.</span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><b><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">Init cluster / Create set / Store path</span></b></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">export CLUSTERNAME=pg_upg<br>export MASTERDBNAME=db1<br>export SLAVEDBNAME=db1_repl<br>export MASTERHOST=node1<br>export SLAVEHOST=node2<br>export MAS_REPLICATIONUSER=appl<br>export SLV_REPLICATIONUSER=user1<br>export MAS_PAS=appl<br>export SLV_PAS=user1<br>export MAS_PORT=5432<br>export SLV_PORT=5632<br><br><br> slonik <<EOF<br> cluster name = $CLUSTERNAME;<br> node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST user=$MAS_REPLICATIONUSER password=$MAS_PAS port=$MAS_PORT';<br> node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST user=$SLV_REPLICATIONUSER password=$SLV_PAS port=$SLV_PORT';<br> init cluster ( id=1, comment = 'Master Node');<br> create set (id=1, origin=1, comment='All pgbench tables');<br> set add table (set id=1, origin=1, id=1, fully qualified name = 'appl.pgbench_accounts', comment='accounts table');<br> set add table (set id=1, origin=1, id=2, fully qualified name = 'appl.pgbench_branches', comment='branches table');<br> set add table (set id=1, origin=1, id=3, fully qualified name = 'appl.pgbench_tellers', comment='tellers table');<br> set add table (set id=1, origin=1, id=4, fully qualified name = 'appl.pgbench_history', comment='history table');<br> create set (id=2, origin=1, comment='All T* tables');<br> ### set add table (set id=2, origin=1, id=1, fully qualified name = 'appl.t1', comment='t1 table');<br> set add table (set id=2, origin=1, id=5, fully qualified name = 'appl.tab1', comment='tab1 table');<br> store node (id=2, comment = 'Slave node', event node=1);<br> store path (server = 1, client = 2, conninfo='dbname=$MASTERDBNAME host=$MASTERHOST user=$MAS_REPLICATIONUSER password=$MAS_PAS port=$MAS_PORT');<br> store path (server = 2, client = 1, conninfo='dbname=$SLAVEDBNAME host=$SLAVEHOST user=$SLV_REPLICATIONUSER password=$SLV_PAS port=$SLV_PORT');<br>EOF<br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><b><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">starting slon deamons</span></b></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">slon $CLUSTERNAME "dbname=$MASTERDBNAME user=$MAS_REPLICATIONUSER host=$MASTERHOST port=$MAS_PORT" -d2 >>master.log</span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">slon $CLUSTERNAME "dbname=$SLAVEDBNAME user=$SLV_REPLICATIONUSER host=$SLAVEHOST port=$SLV_PORT" -d2 >>slave.log</span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><b><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">start of replication</span></b></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">slonik <<_EOF_<br> cluster name = $CLUSTERNAME;<br> #<br> node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST user=$MAS_REPLICATIONUSER password=$MAS_PAS port=$MAS_PORT';<br> node 2 admin conninfo = 'dbname=$SLAVEDBNAME host=$SLAVEHOST user=$SLV_REPLICATIONUSER password=$SLV_PAS port=$SLV_PORT';<br> subscribe set ( id = 1, provider = 1, receiver = 2, forward = no);<br></span><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"> subscribe set ( id = 2, provider = 1, receiver = 2, forward = no);</span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">_EOF_</span></div><div><br></div></div><div><br></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">Regards, </span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;">Nawaz Ahmed </span></div><div><span style="font-size:medium;font-family:'bookman old style', 'new york', times, serif;"><br></span></div></div></div></div></div></div></body></html>