diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index aa14dbbb75..3f3f2633ae 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -209,23 +209,6 @@ GetConnection(void)
 	if (conn_opts)
 		PQconninfoFree(conn_opts);
 
-	/* Set always-secure search path, so malicious users can't get control. */
-	if (dbname != NULL)
-	{
-		PGresult   *res;
-
-		res = PQexec(tmpconn, ALWAYS_SECURE_SEARCH_PATH_SQL);
-		if (PQresultStatus(res) != PGRES_TUPLES_OK)
-		{
-			fprintf(stderr, _("%s: could not clear search_path: %s\n"),
-					progname, PQerrorMessage(tmpconn));
-			PQclear(res);
-			PQfinish(tmpconn);
-			exit(1);
-		}
-		PQclear(res);
-	}
-
 	/*
 	 * Ensure we have the same value of integer timestamps as the server we
 	 * are connecting to.
