[Bucardo-general] Replicating between differently-named schemas

Ami Ganguli ami.ganguli at gmail.com
Tue Feb 7 22:09:43 UTC 2017


Hi.

I'm having a lot of difficulty setting up replication.

I have two databases, local and remote.  I'm replicating between
local.public and remote.foo. A text file, tables.txt, contains the
names of all the tables and sequences.

My setup script:

# === Start Script ===

bucardo add all tables db=local -n public relgroup=local_all
bucardo add all sequences db=local -n public relgroup=local_all
bucardo add all tables db=remote -n remote relgroup=remote_all
bucardo add all sequences db=remote -n remote relgroup=remote_all

cat tables.txt | while read line
do
        bucardo add customname public.$line foo.$line db=remote
        bucardo add customname foo.$line public.$line db=local
done

bucardo add sync up relgroup=local_all dbs=local,remote onetimecopy=1
bucardo add sync down relgroup=remote_all dbs=remote,local

# === End Script ===

The "up" sync appears to be added, but the "down" sync fails with the error:

    Failed to add sync: DBD::Pg::st execute failed: ERROR:  Could not
find schema "foo" in database "local"! at line 30.

Note that the local database has no schema "foo" (we're using "public"
on the local database), so the error makes perfect sense, I just can't
figure out how to convince Bucardo that I want to replicate to public.

I've tried various things, mostly at random.  It's not clear from the
docs which database the db parameter of "add customname" refers to,
for example.  But so far no luck getting this to work.

Any tips would be much appreciated.

Cheers,
Ami.


More information about the Bucardo-general mailing list