pgsql: Refactor replorigin_session_setup() for better readability.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor replorigin_session_setup() for better readability.
Date: 2026-03-26 03:51:59
Message-ID: E1w5blG-001U5U-2K@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor replorigin_session_setup() for better readability.

Reorder the validation checks in replorigin_session_setup() to provide a
more logical flow. This makes the function easier to follow and ensures
that basic state checks are performed consistently.

Additionally, update an error message to align its phrasing with similar
diagnostics in the replication origin subsystem, improving overall
consistency.

Author: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Reviewed-by: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Discussion: https://postgr.es/m/e0508305-bc6a-417c-b969-36564d632f9e@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/735e8fe685359480e77d837493a5dc0a38866944

Modified Files
--------------
src/backend/replication/logical/origin.c | 79 +++++++++++++++++++-------------
1 file changed, 47 insertions(+), 32 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-26 08:07:46 pgsql: Make fixed-length list building macros work in C++
Previous Message Masahiko Sawada 2026-03-26 03:12:43 pgsql: Fix UUID sortability tests in base32hex encoding.