title: How to set up logical postgresql replication correctly (two ways)?
body: <p>I can not solve this problem:</p>
  
  <p>If there are 2 postgresql servers, logical replication (publishing, subscribers) of some tables is used, if it works in one direction - everything is fine, but horror begins in both directions.</p>
  
  <p>Those. On server1 and on server2 there are identical databases with the same tasks table.
  According to the replica, from server1 to server2 only INSERT and UPDATE are transmitted, then on server2, the logic processes the tasks and writes updates the status to tasks, which accordingly flies back to server1 (only UPDATE is taken back to the server).</p>
  
  <p>The problem is that we get a looped replica (it’s enough on the first server to set status 1, then set status 2 on server2 and we see that in our tables the status of the task will change infinitely from 1 to 2 and vice versa endlessly, which makes it difficult with data and litters the logs.
  Unfortunately, there is no way to change the application logic. From ideas, only to include a return response as necessary (that is, not in real-time, but according to a certain schedule so that the status is fixed)</p>