Adding tables to a herd in bucardo

Posted by Joseph the Dreamer on Server Fault See other posts from Server Fault or by Joseph the Dreamer
Published on 2012-09-06T02:05:30Z Indexed on 2012/09/06 3:39 UTC
Read the original article Hit count: 589

Filed under:

Forgive my ignorance, I am a JS programmer given the task to do DB replication using bucardo. I understand the concept of how bucardo works, but setting it up is a bit confusing.

The set-up is:

  • Lubuntu Linux
  • Two databases test_master and test_slave, using PostgreSQL
  • Each DB has a table named test, containing 2 columns: id (PK) and test (int)
  • I use pgAdmin3

I have already added them to bucardo's list of databases and added all tables.

Table: public.test  DB: test_slave   PK: id (int4)
Table: public.test  DB: test_master  PK: id (int4)

As you see, due to the fact that the DBs are identical, even the schema names are identical. So when I do:

bucardo_ctl add herd sample_herd public.test

Ok, so it got added to the herd. But this command gets confused which database public.test comes from. So when I add a sync:

$ bucardo_ctl add sync sample_sync source=sample_herd targetdb=test_slave type=fullcopy
Failed to add sync: DBD::Pg::st execute failed: ERROR:  Source and target databases cannot be the same: test_slave at line 118. at line 30.
CONTEXT:  PL/Perl function "validate_sync" at /usr/bin/bucardo_ctl line 3362.
  • What does it mean that source and target cannot be the same?
  • If it got confused as to which public.test to use as source, how do I differentiate?

© Server Fault or respective owner

Related posts about postgresql