I'm using EDB Replication server to have 3 postgres 14 databases in sync (MMR Replication). I'm using Table Trigger as changeset logging It's working fine for the most part, but I have a problem with Sequences. Although the table rows change properly, the sequence is not updated on replicated tables. I can update the Sequences manually, I use this code:
SELECT SETVAL( (SELECT PG_GET_SERIAL_SEQUENCE('"table"', 'id')), (SELECT (MAX("id") + 1) FROM "table"), FALSE);
and it all works fine after that, but it's a real hassle to run that code every time there is an addition on the database. And for each table affected. Is there a way to update the Sequence during replication automatically?
Machines are all using Windows 10