pglogical icon indicating copy to clipboard operation
pglogical copied to clipboard

What is the prefered way of dealing with sequeneces replication

Open rhollins opened this issue 2 years ago • 1 comments

Hi,

I'm trying to find the best way to deal with sequence replication:

Currently, I'm adding all sequences this way when we setup replication: SELECT pglogical.replication_set_add_all_sequences(set_name := ssome_name, schema_names := ARRAY['schema_name'], synchronize_data := true)

Now the question is as we add new tables and sequences to source db should we just rerun this above command again on daily schedule for example considering the automated synchronization doesn't always work like highlighted in this issue https://github.com/2ndQuadrant/pglogical/issues/163? This would be in order to ensure that source and target both have same sequences.

Also another question should we need to failover to the destination database I assume we need to run: select pglogical.synchronize_sequence( seqoid ) from pglogical.sequence_state; only once to ensure the sequence values are the same.

rhollins avatar May 25 '22 08:05 rhollins

EnterpriseDB mention the sequences are not replicated in real-time here.

And yes, @rhollins , just before cutting off the replication to failover, make sure to run synchronize_sequence.

lpossamai avatar May 17 '23 02:05 lpossamai