Enhance libpqrcv APIs to support slot synchronization.
authorAmit Kapila <akapila@postgresql.org>
Mon, 5 Feb 2024 05:15:34 +0000 (10:45 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 5 Feb 2024 05:24:06 +0000 (10:54 +0530)
commitdafbfed9efbe3d166f25df7e564bad716e9f8bfc
treeeb1479b244be5bed8e3819cd6ddd16544ff6148f
parenta17aa50d67bad4ee39a94988c679d2c2fed0e934
Enhance libpqrcv APIs to support slot synchronization.

This patch provides support for regular (non-replication) connections in
libpqrcv_connect(). This can be used to execute SQL statements on the
primary server without starting a walsender.

A new API libpqrcv_get_dbname_from_conninfo() is also added to extract the
database name from the given connection-info.

Note that this patch doesn't change any existing functionality but later
patches implementing the slot synchronization will use this functionality
to connect to the primary server to fetch required slot information.

Author: Shveta Malik, Hou Zhijie, Ajin Cherian
Reviewed-by: Peter Smith, Bertrand Drouvot, Dilip Kumar, Masahiko Sawada, Nisha Moond, Kuroda Hayato, Amit Kapila
Discussion: https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com
src/backend/commands/subscriptioncmds.c
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
src/backend/replication/logical/tablesync.c
src/backend/replication/logical/worker.c
src/backend/replication/walreceiver.c
src/include/replication/walreceiver.h