Does logical replication supports bidirectional?

392 Views Asked by At

I have created two publications one on each PostgreSQL instance but on the same table. Then I subscribed to these publications from each instance. I didn't see an error in the logs of two instances but I can see replication works on one side i.e. uni-directional.

Does logical replication support bi-directional or not?

Thanks

2

There are 2 best solutions below

1
On BEST ANSWER

No, you cannot use logical replication to replicate the same table in both directions. This would necessitate complicated conflict resolution, which PostgreSQL doesn't have at the moment.

1
On

Postgres v16 started adding a support for bidirectional replication but the feature is not complete yet.

Release notes

There are several access control improvements to logical replication in PostgreSQL 16, including the new predefined role pg_create_subscription, which grants users the ability to create new logical subscriptions. Finally, this release begins adding support for bidirectional logical replication, introducing functionality to replicate data between two tables from different publishers.