v6-0003-Fix-publication-does-not-exist-error.patch
application/octet-stream
Filename: v6-0003-Fix-publication-does-not-exist-error.patch
Type: application/octet-stream
Part: 0
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 v6-0003
Subject: Fix publication does not exist error.
| File | + | − |
|---|---|---|
| src/bin/pg_basebackup/pg_subscriber.c | 3 | 20 |
From 5d2b49e55888cdc36a38208d58cf16a5960821dc Mon Sep 17 00:00:00 2001
From: Shlok Kyal <shlok.kyal.oss@gmail.com>
Date: Mon, 22 Jan 2024 12:36:20 +0530
Subject: [PATCH v6 3/3] Fix publication does not exist error.
Fix publication does not exist error.
---
src/bin/pg_basebackup/pg_subscriber.c | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_subscriber.c b/src/bin/pg_basebackup/pg_subscriber.c
index 0dc87e919b..8b1a92b68b 100644
--- a/src/bin/pg_basebackup/pg_subscriber.c
+++ b/src/bin/pg_basebackup/pg_subscriber.c
@@ -677,6 +677,9 @@ create_all_logical_replication_slots(PrimaryInfo *primary,
if (create_logical_replication_slot(conn, false, perdb) == NULL && !dry_run)
return false;
+ /* Also create a publication */
+ create_publication(conn, primary, perdb);
+
disconnect_database(conn);
}
@@ -1792,26 +1795,6 @@ main(int argc, char **argv)
*/
wait_for_end_recovery(standby.base_conninfo, dbarr.perdb[0].dbname);
- /*
- * Create a publication for each database. This step should be executed
- * after promoting the subscriber to avoid replicating unnecessary
- * objects.
- */
- for (i = 0; i < dbarr.ndbs; i++)
- {
- LogicalRepPerdbInfo *perdb = &dbarr.perdb[i];
-
- /* Connect to publisher. */
- conn = connect_database(primary.base_conninfo, perdb->dbname);
- if (conn == NULL)
- exit(1);
-
- /* Also create a publication */
- create_publication(conn, &primary, perdb);
-
- disconnect_database(conn);
- }
-
/*
* Create a subscription for each database.
*/
--
2.34.1