Re: [Patch] add new parameter to pg_replication_origin_session_setup

Doruk Yilmaz <doruk@mixrank.com>

From: Doruk Yilmaz <doruk@mixrank.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Amit Kapila <amit.kapila16@gmail.com>
Date: 2025-08-18T18:55:19Z
Lists: pgsql-hackers

Attachments

> Your use looks good to me. So, maybe we can update the docs with the
> dangers if the users of API doesn't follow commit order then it may
> lead to data inconsistency should be sufficient. Additionally, we may
> want to give an example as to how to use this API for parallel apply.

That sounds reasonable. I’ve updated the patch and added more
information to the documentation covering the topics you mentioned.
I also added a Caution block so potential users won’t miss it. I hope
this patch meets your expectations.

Commits

  1. Refactor replorigin_session_setup() for better readability.

  2. Prevent unintended dropping of active replication origins.

  3. Add optional pid parameter to pg_replication_origin_session_setup().