diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index db2b9f0d68..a80089ccde 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -335,7 +335,7 @@ appendQualifiedRelation(PQExpBuffer buf, const char *spec,
 	appendStringLiteralConn(&sql, table, conn);
 	appendPQExpBufferStr(&sql, "::pg_catalog.regclass;");
 
-	executeCommand(conn, "RESET search_path", progname, echo);
+	executeCommand(conn, "RESET search_path;", progname, echo);
 
 	/*
 	 * One row is a typical result, as is a nonexistent relation ERROR.
diff --git a/src/include/fe_utils/connect.h b/src/include/fe_utils/connect.h
index fa293d2458..d62f5a3724 100644
--- a/src/include/fe_utils/connect.h
+++ b/src/include/fe_utils/connect.h
@@ -23,6 +23,6 @@
  * might work with the old server, skip this.
  */
 #define ALWAYS_SECURE_SEARCH_PATH_SQL \
-	"SELECT pg_catalog.set_config('search_path', '', false)"
+	"SELECT pg_catalog.set_config('search_path', '', false);"
 
 #endif							/* CONNECT_H */
