diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 2cb3f9b083..f9f752caee 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -16272,6 +16272,15 @@ dumpAttrDef(Archive *fout, AttrDefInfo *adinfo)
 	if (!adinfo->separate)
 		return;
 
+	/*
+	 * Skip if the column is an inherited column and a generated column;
+	 * inherited columns must have the same generation expression as
+	 * the parent's expression and we don't support setting the generation
+	 * expression on the column by ALTER TABLE.
+	 */
+	if (!tbinfo->attislocal[adnum - 1] && tbinfo->attgenerated[adnum - 1])
+		return;
+
 	q = createPQExpBuffer();
 	delq = createPQExpBuffer();
 
