diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index 0296b9bb5e..02019fcc84 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -210,6 +210,7 @@ typedef struct Archive
 	/* other important stuff */
 	char	   *searchpath;		/* search_path to set during restore */
 	char	   *use_role;		/* Issue SET ROLE to this */
+	char	   *default_toast_compression;
 
 	/* error handling */
 	bool		exit_on_error;	/* whether to exit on SQL errors... */
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f8bec3ffcc..ee2c7153e5 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1248,6 +1248,21 @@ setup_connection(Archive *AH, const char *dumpencoding,
 
 		AH->sync_snapshot_id = get_synchronized_snapshot(AH);
 	}
+
+	/*
+	 * Get default TOAST compression method, but not if the server's too
+	 * old to support the feature or if the user doesn't want to dump that
+	 * information anyway.
+	 */
+	if (AH->remoteVersion >= 140000 && !dopt->no_toast_compression)
+	{
+		PGresult   *res;
+
+		res = ExecuteSqlQueryForSingleRow(AH,
+										  "SHOW default_toast_compression");
+		AH->default_toast_compression = pg_strdup(PQgetvalue(res, 0, 0));
+		PQclear(res);
+	}
 }
 
 /* Set up connection for a parallel worker process */
@@ -15926,7 +15941,9 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
 								break;
 						}
 
-						if (cmname != NULL)
+						if (cmname != NULL &&
+							strcmp(cmname,
+								   fout->default_toast_compression) != 0)
 							appendPQExpBuffer(q, " COMPRESSION %s", cmname);
 					}
 
