T
T
terrator2017-10-13 14:57:23
PostgreSQL
terrator, 2017-10-13 14:57:23

Postgre 10 bidirectional replication?

Good afternoon, It is
necessary to configure PostgreSQL 10 bidirectional replication, I
tried using the DBMS itself, I got a recursive collapse
as follows: I
created 2 instances on localhost
initdb -D "folder1"
initdb -D "folder2"
registered, launched (on different ports)
created publications signed them to each other
CREATE PUBLICATION testpub FOR TABLE users;
CREATE SUBSCRIPTION testsub CONNECTION 'host=127.0.0.1 port=5432 user=postgres password=root dbname=postgres'
PUBLICATION testpub;
ALTER TABLE users REPLICA IDENTITY FULL;
in configs in postgresql.conf
wal_level = logical
archive_mode = off
in pg_hba.conf
host replication all 127.0.0.1/32 trust
the essence of the problem is that if you put a primary key - when you try to insert a record, for example - there will be an endless cycle of errors, and if without a primary key an endless recursive insert into both databases
, the BDR solution was googled, but it is only under linux and It seems like it does not support version 10 yet.
There are 3 servers in different cities, it is necessary that requests to change data automatically fall on the remaining 2 servers, synchronously or asynchronously, it does not matter.
The question is, is there a way to correctly configure postgre 10 bidirectional replication under Windows without additional utilities?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question