&bdr_init_replica_script_path[0]) < 0)
{
elog(ERROR, "bdr: failed to find " BDR_INIT_REPLICA_CMD
- " relative to binary %s or wrong version (expected %s)",
- my_exec_path, PG_VERSION);
+ " relative to binary %s or wrong version. Expected (PostgreSQL %s, BDR %s)",
+ my_exec_path, PG_VERSION, BDR_VERSION);
}
if (find_other_exec(my_exec_path, BDR_DUMP_CMD,
"%s fallback_application_name='"BDR_LOCALID_FORMAT": %s: init_replica restore'",
cfg->replica_local_dsn, BDR_LOCALID_FORMAT_ARGS, cfg->name);
+ /*
+ * Suppress replication of changes applied via pg_restore back to
+ * the local node.
+ *
+ * XXX DYNCONF: This should PQconninfoParse, modify the options keyword or
+ * add it, and reconstruct the string using the functions from pg_dumpall
+ * (also to be used for init_copy). This is a hack.
+ */
+ appendStringInfoString(&local_dsn,
+ " options='-c bdr.do_not_replicate=on -c bdr.permit_unsafe_ddl_commands=on -c bdr.skip_ddl_replication=on -c bdr.skip_ddl_locking=on'");
+
tmpdir = palloc(strlen(bdr_temp_dump_directory)+32);
sprintf(tmpdir, "%s/postgres-bdr-%s.%d", bdr_temp_dump_directory,
snapshot, getpid());
fi
errlog "Restoring dump to local DB \"$TARGET\" with $JOBS concurrent workers from \"$TMPDIR\""
-if ! PGOPTIONS="-c bdr.permit_unsafe_ddl_commands=true -c bdr.skip_ddl_replication=true" "$PGRESTORE" --exit-on-error --single-transaction -j $JOBS -F d -d "$TARGET" $TMPDIR; then
+if ! "$PGRESTORE" --exit-on-error --single-transaction -j $JOBS -F d -d "$TARGET" $TMPDIR; then
errlog "pg_restore to "$TARGET" failed, aborting"
exit 2
fi