If I want to promote a logical replica in PostgreSQL, do I have to do any additional setup besides stopping the replication?
I think I can see is sequence values are not replicated so I have do something like pg_dump -d dbname -U username -t '*_id_seq' > seq.sql
to dump the sequence and copy to the logical replica to be promoted. Is there a better way to do this?
pg_sequences
and usenextval()
.