diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 681d208f81..61ed59d4f1 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -44,7 +44,7 @@ #include "utils/memutils.h" #include "utils/syscache.h" -static List *fetch_table_list(WalReceiverConn *wrconn, List *publications); +static List *fetch_table_list(WalReceiverConn *walrconn, List *publications); /* * Common option parsing function for CREATE and ALTER SUBSCRIPTION commands. @@ -430,14 +430,14 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) { XLogRecPtr lsn; char *err; - WalReceiverConn *wrconn; + WalReceiverConn *walrconn; List *tables; ListCell *lc; char table_state; /* Try to connect to the publisher. */ - wrconn = walrcv_connect(conninfo, true, stmt->subname, &err); - if (!wrconn) + walrconn = walrcv_connect(conninfo, true, stmt->subname, &err); + if (!walrconn) ereport(ERROR, (errmsg("could not connect to the publisher: %s", err))); @@ -453,7 +453,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) * Get the table list from publisher and build local table status * info. */ - tables = fetch_table_list(wrconn, publications); + tables = fetch_table_list(walrconn, publications); foreach(lc, tables) { RangeVar *rv = (RangeVar *) lfirst(lc); @@ -478,7 +478,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) { Assert(slotname); - walrcv_create_slot(wrconn, slotname, false, + walrcv_create_slot(walrconn, slotname, false, CRS_NOEXPORT_SNAPSHOT, &lsn); ereport(NOTICE, (errmsg("created replication slot \"%s\" on publisher", @@ -487,7 +487,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) } PG_FINALLY(); { - walrcv_disconnect(wrconn); + walrcv_disconnect(walrconn); } PG_END_TRY(); } @@ -835,7 +835,7 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) char originname[NAMEDATALEN]; char *err = NULL; RepOriginId originid; - WalReceiverConn *wrconn = NULL; + WalReceiverConn *walrconn = NULL; StringInfoData cmd; Form_pg_subscription form; @@ -982,8 +982,8 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) initStringInfo(&cmd); appendStringInfo(&cmd, "DROP_REPLICATION_SLOT %s WAIT", quote_identifier(slotname)); - wrconn = walrcv_connect(conninfo, true, subname, &err); - if (wrconn == NULL) + walrconn = walrcv_connect(conninfo, true, subname, &err); + if (walrconn == NULL) ereport(ERROR, (errmsg("could not connect to publisher when attempting to " "drop the replication slot \"%s\"", slotname), @@ -996,7 +996,7 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) { WalRcvExecResult *res; - res = walrcv_exec(wrconn, cmd.data, 0, NULL); + res = walrcv_exec(walrconn, cmd.data, 0, NULL); if (res->status != WALRCV_OK_COMMAND) ereport(ERROR, @@ -1012,7 +1012,7 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) } PG_FINALLY(); { - walrcv_disconnect(wrconn); + walrcv_disconnect(walrconn); } PG_END_TRY(); @@ -1124,7 +1124,7 @@ AlterSubscriptionOwner_oid(Oid subid, Oid newOwnerId) * publisher connection. */ static List * -fetch_table_list(WalReceiverConn *wrconn, List *publications) +fetch_table_list(WalReceiverConn *walrconn, List *publications) { WalRcvExecResult *res; StringInfoData cmd; @@ -1154,7 +1154,7 @@ fetch_table_list(WalReceiverConn *wrconn, List *publications) } appendStringInfoChar(&cmd, ')'); - res = walrcv_exec(wrconn, cmd.data, 2, tableRow); + res = walrcv_exec(walrconn, cmd.data, 2, tableRow); pfree(cmd.data); if (res->status != WALRCV_OK_TUPLES)