*** a/src/backend/commands/subscriptioncmds.c --- b/src/backend/commands/subscriptioncmds.c *************** *** 545,563 **** DropSubscription(DropSubscriptionStmt *stmt) "drop the replication slot \"%s\"", slotname), errdetail("The error was: %s", err))); ! if (!walrcv_command(wrconn, cmd.data, &err)) { /* Close the connection in case of failure */ walrcv_disconnect(wrconn); ! ereport(ERROR, ! (errmsg("could not drop the replication slot \"%s\" on publisher", ! slotname), ! errdetail("The error was: %s", err))); } ! else ! ereport(NOTICE, ! (errmsg("dropped replication slot \"%s\" on publisher", ! slotname))); walrcv_disconnect(wrconn); --- 545,569 ---- "drop the replication slot \"%s\"", slotname), errdetail("The error was: %s", err))); ! PG_TRY(); ! { ! if (!walrcv_command(wrconn, cmd.data, &err)) ! ereport(ERROR, ! (errmsg("could not drop the replication slot \"%s\" on publisher", ! slotname), ! errdetail("The error was: %s", err))); ! else ! ereport(NOTICE, ! (errmsg("dropped replication slot \"%s\" on publisher", ! slotname))); ! } ! PG_CATCH(); { /* Close the connection in case of failure */ walrcv_disconnect(wrconn); ! PG_RE_THROW(); } ! PG_END_TRY(); walrcv_disconnect(wrconn);