Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5111~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5111
Choose a head ref
  • 7 commits
  • 55 files changed
  • 2 contributors

Commits on Aug 9, 2025

  1. Enhance pg_get_sequence_data function

    This patch enhances 'pg_get_sequence_data' to return the sequence’s
    log_cnt and associated page LSN.
    
    In the subsequent patches, When a sequence is synchronized to the
    subscriber, the page LSN of the sequence from the publisher is also
    captured and stored in pg_subscription_rel.srsublsn. This LSN will
    reflect the state of the sequence at the time of synchronization.
    By comparing the current LSN of the sequence on the publisher
    (via pg_sequence_state()) with the stored LSN on the subscriber, users
    can detect if the sequence has advanced and is now out-of-sync. This
    comparison will help determine whether re-synchronization is needed for a
    given sequence.
    
    Author: Vignesh C, Tomas Vondra
    Reviewer:  Amit Kapila, Shveta Malik, Dilip Kumar, Peter Smith, Nisha Moond
    Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
    vigneshwaran-c authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    c2bf2f2 View commit details
    Browse the repository at this point in the history
  2. Introduce "ALL SEQUENCES" support for PostgreSQL logical replication

    This commit enhances logical replication by enabling the inclusion of all
    sequences in publications.
    
    Furthermore, enhancements to psql commands now display which
    publications contain the specified sequence (\d command), and if a
    specified publication includes all sequences (\dRp command).
    
    Note: This patch currently supports only the "ALL SEQUENCES" clause.
    Handling of clauses such as "FOR SEQUENCE" and "FOR SEQUENCES IN SCHEMA"
    will be addressed in a subsequent patch.
    
    "ALL SEQUENCES" can be combined with "ALL TABLES" (e.g., 'FOR ALL SEQUENCES, ALL TABLES')
    in a 'FOR ALL' publication. It cannot be combined with other options
    such as TABLE or TABLES IN SCHEMA.
    
    Author: Vignesh C, Tomas Vondra
    Reviewer:  Amit Kapila, Shveta Malik, Dilip Kumar, Peter Smith, Nisha Moond
    Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
    vigneshwaran-c authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    5524b09 View commit details
    Browse the repository at this point in the history
  3. Reorganize tablesync Code and Introduce syncutils

    Reorganized the tablesync code by creating a new syncutils file.
    This refactoring will facilitate the development of sequence
    synchronization worker code.
    
    This commit separates code reorganization from functional changes,
    making it clearer to reviewers that only existing code has been moved.
    The changes in this patch can be merged with subsequent patches during
    the commit process.
    
    Author: Vignesh C
    Reviewer:  Amit Kapila, Shveta Malik, Dilip Kumar, Peter Smith, Nisha Moond
    Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
    vigneshwaran-c authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    44b4323 View commit details
    Browse the repository at this point in the history
  4. Introduce "REFRESH PUBLICATION SEQUENCES" for subscriptions

    This patch adds support for a new SQL command:
    ALTER SUBSCRIPTION ... REFRESH PUBLICATION SEQUENCES
    This command synchronizes the set of sequences associated with a
    subscription based on the sequences currently present in the publication
    on the publisher. It also marks the corresponding entries in the
    pg_subscription_rel catalog table with the INIT state to trigger
    resynchronization.
    
    Additionally, the following subscription commands:
    ALTER SUBSCRIPTION ... REFRESH PUBLICATION
    ALTER SUBSCRIPTION ... ADD PUBLICATION
    ALTER SUBSCRIPTION ... DROP PUBLICATION
    ALTER SUBSCRIPTION ... SET PUBLICATION
    have been extended to also refresh sequence mappings. These commands will:
    Add newly published sequences that are not yet part of the subscription.
    Remove sequences that are no longer included in the publication.
    
    This ensures that sequence replication remains aligned with the current
    state of the publication on the publisher side, improving consistency
    and reducing manual maintenance.
    
    Author: Vignesh C, Tomas Vondra
    Reviewer:  Amit Kapila, Shveta Malik, Dilip Kumar, Peter Smith, Nisha Moond
    Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
    vigneshwaran-c authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    8fe2199 View commit details
    Browse the repository at this point in the history
  5. New worker for sequence synchronization during subscription management

    This patch introduces sequence synchronization:
    Sequences have 2 states:
       - INIT (needs synchronizing)
       - READY (is already synchronized)
    
    A new sequencesync worker is launched as needed to synchronize sequences.
    It does the following:
        a) Retrieves remote values of sequences with pg_sequence_state() INIT.
        b) Logs a warning if the sequence parameters differ between the publisher and subscriber.
        c) Sets the local sequence values accordingly.
        d) Updates the local sequence state to READY.
        e) Repeats until all done; Commits synchronized sequences in batches of 100
    
    Sequence synchronization occurs in 3 places:
    1) CREATE SUBSCRIPTION
        - (PG19 command syntax is unchanged)
        - The subscriber retrieves sequences associated with publications.
        - Published sequences are added to pg_subscription_rel with INIT state.
        - Initiate the sequencesync worker (see above) to synchronize all
          sequences.
    
    2) ALTER SUBSCRIPTION ... REFRESH PUBLICATION
        - (PG19 command syntax is unchanged)
        - Dropped published sequences are removed from pg_subscription_rel.
        - Newly published sequences are added to pg_subscription_rel with INIT state.
        - Initiate the sequencesync worker (see above) to synchronize only
          newly added sequences.
    
    3) ALTER SUBSCRIPTION ... REFRESH PUBLICATION SEQUENCES
        - The patch introduces this new command to refresh all sequences
        - Dropped published sequences are removed from pg_subscription_rel.
        - Newly published sequences are added to pg_subscription_rel
        - All sequences in pg_subscription_rel are reset to INIT state.
        - Initiate the sequencesync worker (see above) to synchronize all
          sequences.
    
    Author: Vignesh C
    Reviewer:  Amit Kapila, Shveta Malik, Dilip Kumar, Peter Smith, Nisha Moond
    Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
    vigneshwaran-c authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    a548709 View commit details
    Browse the repository at this point in the history
  6. Documentation for sequence synchronization feature.

    Documentation for sequence synchronization feature.
    
    Author: Vignesh C
    Reviewer:  Amit Kapila, Shveta Malik, Dilip Kumar, Peter Smith, Nisha Moond
    Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
    vigneshwaran-c authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    8546a8b View commit details
    Browse the repository at this point in the history
  7. [CF 5111] v20250806 - Synchronization of sequences to subscriber

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5111
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/CALDaNm05eFK4vB6pihNHVoob9412eQjzCeuP5vVK1EutAZ+B+Q@mail.gmail.com
    Author(s): vigneshwaran C
    Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    c842d55 View commit details
    Browse the repository at this point in the history
Loading