From my understanding logical replication in Postgres does not replicate sequence data. Let's assume we have two multi-master postgres servers
server1
test_table
current sequence 100
server2
test_table
current sequence 90
If server1 goes down and server2 will take over for the writes, what would happen when it tries to insert a row with sequence of 90? Since server1 has already inserted a row that has an id of 90. What are some workarounds for this?
setup the two sequences so that they do not clash.
eg use INCREMENT BY 2 on both sequences and have server 1 give odd numbers and server 2 give even numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With