Re: [Patch] add new parameter to pg_replication_origin_session_setup

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: shveta malik <shveta.malik@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, Doruk Yilmaz <doruk@mixrank.com>
Date: 2026-01-14T09:58:23Z
Lists: pgsql-hackers
On Wed, Jan 14, 2026 at 9:13 AM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Others are corrected and adjusted by me, see the attached.
> 0001 and 0002 are combined because no one claimed them.
>

A change similar to what you did in replorigin_state_clear() was
required in replorigin_advance() to prevent advancing origin via APIs
when it is still in use. I made that change and pushed the patch.
Thanks for working on it.

-- 
With Regards,
Amit Kapila.



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().