Thread

Commits

  1. Add optional pid parameter to pg_replication_origin_session_setup().

  1. Allow using replication origins in SQL level parallel sessions

    Emre Hasegeli <emre@hasegeli.com> — 2025-09-04T18:02:02Z

    Replication origins is a useful feature for external replication
    systems to do conflict resolution in bi-directional replication.  It's
    possible for the external systems to make use of this feature using
    the SQL functions pg_replication_origin_*().
    
    pg_replication_origin_session_setup() is the one to configure the
    current session.  Currently, only a single version of this function is
    exposed that allows one replica origin to be used only by a single
    session.  This limits the usefulness of this feature.
    
    The attached patch creates another variant of this function
    pg_replication_origin_session_setup(text, int).  This allows the same
    replica origin to be used by parallel sessions the same way logical
    replication apply workers are using it.
    
    I'll add this to the next commitfest.
    
  2. Re: Allow using replication origins in SQL level parallel sessions

    Amit Kapila <amit.kapila16@gmail.com> — 2025-09-05T11:25:43Z

    On Thu, Sep 4, 2025 at 11:32 PM Emre Hasegeli <emre@hasegeli.com> wrote:
    >
    > Replication origins is a useful feature for external replication
    > systems to do conflict resolution in bi-directional replication.  It's
    > possible for the external systems to make use of this feature using
    > the SQL functions pg_replication_origin_*().
    >
    > pg_replication_origin_session_setup() is the one to configure the
    > current session.  Currently, only a single version of this function is
    > exposed that allows one replica origin to be used only by a single
    > session.  This limits the usefulness of this feature.
    >
    > The attached patch creates another variant of this function
    > pg_replication_origin_session_setup(text, int).  This allows the same
    > replica origin to be used by parallel sessions the same way logical
    > replication apply workers are using it.
    >
    
    We are already discussing the same feature in an email thread [1]. Can
    you check that and share your inputs there?
    
    [1] - https://www.postgresql.org/message-id/CAMPB6wfe4zLjJL8jiZV5kjjpwBM2%3DrTRme0UCL7Ra4L8MTVdOg%40mail.gmail.com
    
    -- 
    With Regards,
    Amit Kapila.