v24-0017-Address-comments-From-Vignesh-3.patch

application/octet-stream

Filename: v24-0017-Address-comments-From-Vignesh-3.patch
Type: application/octet-stream
Part: 16
Message: RE: speed up a logical replica setup

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v24-0017
Subject: Address comments From Vignesh #3
File+
src/bin/pg_basebackup/pg_createsubscriber.c 3 3
From 49ca0b2fb21252ceed7ff8bc91bbd8cf33ab7909 Mon Sep 17 00:00:00 2001
From: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Date: Thu, 22 Feb 2024 11:07:22 +0000
Subject: [PATCH v24 17/18]  Address comments From Vignesh #3

---
 src/bin/pg_basebackup/pg_createsubscriber.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c
index 86e277b339..63b76bda12 100644
--- a/src/bin/pg_basebackup/pg_createsubscriber.c
+++ b/src/bin/pg_basebackup/pg_createsubscriber.c
@@ -766,7 +766,7 @@ check_publisher(LogicalRepInfo *dbinfo)
 	if (primary_slot_name)
 	{
 		appendPQExpBuffer(str,
-						  "SELECT 1 FROM pg_replication_slots "
+						  "SELECT 1 FROM pg_catalog.pg_replication_slots "
 						  "WHERE active AND slot_name = '%s'",
 						  primary_slot_name);
 
@@ -940,7 +940,7 @@ check_subscriber(LogicalRepInfo *dbinfo)
 	 *------------------------------------------------------------------------
 	 */
 	res = PQexec(conn,
-				 "SELECT setting FROM pg_settings WHERE name IN ("
+				 "SELECT setting FROM pg_catalog.pg_settings WHERE name IN ("
 				 "'max_logical_replication_workers', "
 				 "'max_replication_slots', "
 				 "'max_worker_processes', "
@@ -2015,6 +2015,7 @@ main(int argc, char **argv)
 		if (conn != NULL)
 		{
 			drop_replication_slot(conn, &dbinfo[0], primary_slot_name);
+			disconnect_database(conn);
 		}
 		else
 		{
@@ -2022,7 +2023,6 @@ main(int argc, char **argv)
 						   primary_slot_name);
 			pg_log_warning_hint("Drop this replication slot soon to avoid retention of WAL files.");
 		}
-		disconnect_database(conn);
 	}
 
 	/* Stop the subscriber */
-- 
2.43.0