#be carefull this will erase bucardo database
psql -U postgres -c 'drop database if exists bucardo'
bucardo_ctl install
psql -U postgres -c 'CREATE DATABASE one'
psql -U postgres -d one -c "
CREATE TABLE customers
(
id serial NOT NULL,
nome character varying(50),
CONSTRAINT customers_pkey PRIMARY KEY (id)
)
"
psql -U postgres -c 'CREATE DATABASE two TEMPLATE one'
bucardo_ctl add db one
bucardo_ctl add table customers herd=alpha standard_conflict=source ping=false db=one
bucardo_ctl add db two
bucardo_ctl add sync replica source=alpha targetdb=two type=swap
echo "now run bucardo_ctl start as root and test the replication inserting / changing data in one.customers and two.customers"