Commits on Aug 21, 2026
-
Include sequences in publications created by pg_createsubscriber
pg_createsubscriber creates a publication on the publisher to establish logical replication between the original primary and the converted subscriber. Currently, the publication is created with FOR ALL TABLES, which ensures that table data changes are replicated during the upgrade process. However, sequence state is not replicated as part of this workflow. Recent additions to logical replication introduced support for publishing all sequences and synchronizing sequence state through subscription refresh. By creating publications with FOR ALL TABLES, ALL SEQUENCES, pg_createsubscriber can take advantage of these capabilities and allow sequence state to be synchronized before the upgraded node is promoted. This change modifies pg_createsubscriber to include ALL SEQUENCES in the publication it creates. Administrators can then run ALTER SUBSCRIPTION ... REFRESH SEQUENCES after the upgrade to synchronize sequence state, ensuring a more complete and reliable upgrade workflow.