diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 13bfd2c..954f428 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1391,14 +1391,41 @@ selectDumpableTable(TableInfo *tbinfo, Archive *fout)
 
 	/*
 	 * If specific tables are being dumped, dump just those tables; else, dump
-	 * according to the parent namespace's dump flag.
+	 * according to the parent namespace's dump flag. Note that the parent
+	 * namespace may be itself part of an extension, but not the table, in
+	 * which case its content needs to be explicitely dumped.
 	 */
 	if (table_include_oids.head != NULL)
 		tbinfo->dobj.dump = simple_oid_list_member(&table_include_oids,
 												   tbinfo->dobj.catId.oid) ?
 			DUMP_COMPONENT_ALL : DUMP_COMPONENT_NONE;
 	else
-		tbinfo->dobj.dump = tbinfo->dobj.namespace->dobj.dump_contains;
+	{
+		if (checkExtensionMembership(&tbinfo->dobj.namespace->dobj, fout))
+		{
+			/*
+			 * Table will be dumpable if no namespace include clause was passed,
+			 * or if the tables namespace is in the list of of included schema.
+			 * In any other case, the table will not be dumpable.
+			 */
+			if (schema_include_oids.head == NULL ||
+				simple_oid_list_member(&schema_include_oids,
+									   tbinfo->dobj.namespace->dobj.catId.oid))
+				tbinfo->dobj.dump = DUMP_COMPONENT_ALL;
+			else
+				tbinfo->dobj.dump = DUMP_COMPONENT_NONE;
+			/*
+			 * If we excluded the namespace we should exclude the table as well.
+			 * It seems incorrect, as the namespace will in any case get created
+			 * during the restore by the extension.
+			 */
+			if (simple_oid_list_member(&schema_exclude_oids,
+							   tbinfo->dobj.namespace->dobj.catId.oid))
+				tbinfo->dobj.dump = DUMP_COMPONENT_NONE;
+		}
+		else
+			tbinfo->dobj.dump = tbinfo->dobj.namespace->dobj.dump_contains;
+	}
 
 	/*
 	 * In any case, a table can be excluded by an exclusion switch
