[Bucardo-general] Help creating herd

Brian Peschel brianp at occinc.com
Mon Jul 11 18:48:58 UTC 2016

I have successfully configured Bucardo to replicate a database.  But I 
have run into problems adding a second database, namely because I have a 
table that shares a name in both databases.  And I don't know how to get 
"bucardo add herd" to specify which database I want. This is under 
Ubuntu 14 (64 bit), Postgres 9.3.13, and Bucardo 5.4.1.

Config for the first database
bucardo list databases
Database: msl_devu14_64     Status: active  Conn: psql -U bucardo -d msl
Database: msl_sysmsl Status: active  Conn: psql -U bucardo -d msl

bucardo list tables
25. Table: public.center_split_parms  DB: msl_sysmsl PK: state|county 
26. Table: public.county              DB: msl_sysmsl PK: rid (integer)
27. Table: public.grid                DB: msl_sysmsl PK: 
rid|county|state (integer|int4|int4)
28. Table: public.parcel              DB: msl_sysmsl PK: rid (integer)
29. Table: public.parcel_name         DB: msl_sysmsl PK: rid|seq 
30. Table: public.place               DB: msl_sysmsl PK: rid (integer)
31. Table: public.rule_zone           DB: msl_sysmsl PK: state_no|id 
32. Table: public.state               DB: msl_sysmsl PK: state (integer)
33. Table: public.street              DB: msl_sysmsl PK: rid (integer)
34. Table: public.update_time         DB: msl_sysmsl PK: 
state|county|tbl_name (integer|int4|text)

bucardo list sequences
Sequence: public.id_seq       DB: msl_sysmsl

bucardo list herds
Relgroup: msl_herd  DB: msl_sysmsl  Members: public.center_split_parms, 
public.county, public.grid, public.id_seq, public.parcel, 
public.parcel_name, public.place, public.rule_zone, public.state, 
public.street, public.update_time
   Used in syncs: msl_sync

bucardo list syncs
Sync "msl_sync"  Relgroup "msl_herd" [Active]
   DB group "msl_sync" msl_devu14_64:target msl_sysmsl:source

I then added my next database, tables, and sequences:
bucardo add database stringsDB_sysmsl dbname=stringsDB
bucardo add table db=stringsDB_sysmsl public.district public.names 
bucardo add sequence db=stringsDB_sysmsl public.name_id public.district_id

As you can see from my table list, I now have 2 tables named place
bucardo list tables place
30. Table: public.place  DB: msl_sysmsl        PK: rid (integer)
38. Table: public.place  DB: stringsDB_sysmsl  PK: id (integer)

If I try to create my herd, it is always taking the the lower ID'd 
table, which fails because it spans 2 databases:
bucardo add herd stringsDB_herd public.district public.names 
public.place public.name_id public.district_id
Created relgroup "stringsDB_herd"
DBD::Pg::st execute failed: ERROR:  Cannot have relations from different 
databases in the same relgroup (5) at line 17.
CONTEXT:  PL/Perl function "herdcheck" at /usr/local/bin/bucardo line 4092.

Any thoughts here?  I don't see anything on the wiki dealing with this 
error or how to be more specific than public.place.  I've tried pretty 
much everything I could think of
bucardo add herd stringsDB_herd public.district public.names 
stringsDB_sysmsl.public.place public.name_id public.district_id
Created relgroup "stringsDB_herd"
Did not find matches for the following terms:
The following tables or sequences are now part of the relgroup 


Here are all the various combinations I have tried:

I also tried
bucardo add herd stringsDB_herd dbname=stringsDB public.district 
public.names public.place public.name_id public.district_id


bucardo add herd stringsDB_herd dbname=stringsDB_sysmsl public.district 
public.names public.place public.name_id public.district_id

I am pretty much at a loss.  TIA!

- Brian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20160711/52af9f92/attachment.html>

More information about the Bucardo-general mailing list