diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index b6794d0..f7b2840 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -3491,20 +3491,20 @@ dumpPublication(Archive *fout, PublicationInfo *pubinfo)
 		first = false;
 	}
 
-	if (!first)
-		appendPQExpBufferStr(query, ", ");
-
 	if (pubinfo->pubupdate)
 	{
+		if (!first)
+			appendPQExpBufferStr(query, ", ");
+
 		appendPQExpBufferStr(query, "update");
 		first = false;
 	}
 
-	if (!first)
-		appendPQExpBufferStr(query, ", ");
-
 	if (pubinfo->pubdelete)
 	{
+		if (!first)
+			appendPQExpBufferStr(query, ", ");
+
 		appendPQExpBufferStr(query, "delete");
 		first = false;
 	}
