Try PostgreSQL 19 Logical Replication of Sequences from a Desktop GUI (FOR ALL SEQUENCES)
Try PostgreSQL 19 sequence logical replication from a desktop GUI: run CREATE PUBLICATION ... FOR ALL SEQUENCES and ALTER SUBSCRIPTION ... REFRESH SEQUENCES in HiDataLinker, inspect sequences in the object tree, and respect the official limits on incremental updates.
正文目前为英文。
On 19 November 2026 the PostgreSQL Global Development Group announced PostgreSQL 19. Among the distributed-data changes is logical replication of sequence values, published with CREATE PUBLICATION ... FOR ALL SEQUENCES. InfoQ's 22 November recap also notes that logical replication now supports sequence values. This guide shows how to try that SQL from HiDataLinker, a free MIT PostgreSQL desktop GUI (MySQL in the same client): local-first credentials, URL paste, Dump / same-engine migrate, and no seat, connection, or tab freemium wall.
These statements require a PostgreSQL 19+ publisher. Confirm both servers with SELECT version();.
What HiDataLinker actually ships
HiDataLinker v1.3.0 includes a SQL editor and a richer object tree that lists sequences. Paste a postgresql:// URL or DATABASE_URL, keep the profile on your machine, open one session to the publisher and another to the subscriber, and run the documented commands yourself.
It does not ship a logical-replication wizard, a publication designer, or in-app controls for wal_level, replication slots, or subscriptions. It will not refresh sequence values on a schedule. Dump / same-engine migrate in v1.3.0 can preserve sequence definitions on a PostgreSQL-to-PostgreSQL copy; that is a backup path, not publication and subscription.
For REPACK, ON CONFLICT DO SELECT, and visual EXPLAIN, see Try PostgreSQL 19 SQL from a Desktop GUI. This page covers only sequence logical replication.
1. Connect to the publisher and the subscriber
- Install from hidatalinker.onesolo.app.
- Open New Connection for each server — paste the URI or fill host, port, user, password, and database. See paste a DATABASE_URL.
- Test, then connect. Profiles stay on your machine — local-first, no hosted workspace.
- In the object tree, confirm the sequences you care about exist on both sides.
Official logical replication restrictions still say schema and DDL are not replicated. Create matching sequence definitions on the subscriber first (by hand or with pg_dump --schema-only). The sequence replication docs require those definitions to match; if they do not, the synchronization worker logs an error until you align them with ALTER SEQUENCE.
2. Publish with CREATE PUBLICATION ... FOR ALL SEQUENCES
On the publisher (PostgreSQL 19+), run this in the SQL editor:
CREATE PUBLICATION pub_sequences FOR ALL SEQUENCES;
Per CREATE PUBLICATION, FOR ALL SEQUENCES synchronizes all sequences in the database, including ones created later. Only persistent sequences are included; temporary and unlogged sequences are excluded. PostgreSQL 19 can raise the effective WAL level to logical when you create the first logical replication slot — server behavior, not a HiDataLinker toggle. You still need privileges to create a publication and a slot.
3. Subscribe and copy the initial values
On the subscriber, create the subscription. Officially, copy_data defaults to true, and that initial copy is how sequence values first arrive:
CREATE SUBSCRIPTION sub_sequences
CONNECTION 'host=publisher.example dbname=app user=replicator'
PUBLICATION pub_sequences;
Use your real connection settings. Credentials in the CONNECTION string show up in the statement and in logs — prefer a dedicated replication role. After CREATE SUBSCRIPTION, a sequence synchronization worker runs and then exits, limited by max_sync_workers_per_subscription. Check values with SELECT last_value, is_called FROM my_sequence;. The object tree lists the sequence; it is not a live replication monitor.
4. Refresh before switchover — incremental changes are not replicated
The restrictions page is explicit: incremental sequence changes are not replicated. Table data for serial or identity columns still flows with the table, but the sequence object on the subscriber keeps the last synchronized value. Before a switchover or failover, refresh:
-- Pick up sequences added to the publication after subscribe
ALTER SUBSCRIPTION sub_sequences REFRESH PUBLICATION;
-- Re-synchronize values for sequences the subscription already knows
ALTER SUBSCRIPTION sub_sequences REFRESH SEQUENCES;
ALTER SUBSCRIPTION distinguishes the two: REFRESH PUBLICATION updates which sequences are subscribed; REFRESH SEQUENCES re-syncs currently subscribed sequences without changing that set. It only helps for sequences already known to the subscription.
If you compare LSNs (pg_get_sequence_data() on the publisher versus pg_subscription_rel.srsublsn on the subscriber), remember the official warning: a sequence typically caches a block of values (often 32) before writing WAL, so LSN comparison can miss drift inside that cache. Run the statements in the SQL editor. HiDataLinker will not schedule a refresh or warn you that sequences have drifted.
HiDataLinker is a thin Tauri desktop app for PostgreSQL and MySQL — paste DATABASE_URL, keep creds local, and avoid seat / connection / tab freemium walls. Honest v1: MySQL + PostgreSQL as marketed; not a logical-replication console. Overview: /db-client.
Soft next step
Need a desktop GUI that can run PostgreSQL 19 CREATE PUBLICATION ... FOR ALL SEQUENCES and ALTER SUBSCRIPTION ... REFRESH SEQUENCES in a SQL editor, and show sequences in the object tree, without a freemium wall?
- Download: https://hidatalinker.onesolo.app/
- Source: https://github.com/henrybit/HiDataLinker