@@ -14028,10 +14028,6 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
14028
14028
int nconfigitems ;
14029
14029
int nconditionitems ;
14030
14030
14031
- /* Tables of not-to-be-dumped extensions shouldn't be dumped */
14032
- if (!curext -> dobj .dump )
14033
- continue ;
14034
-
14035
14031
if (parsePGArray (extconfig , & extconfigarray , & nconfigitems ) &&
14036
14032
parsePGArray (extcondition , & extconditionarray , & nconditionitems ) &&
14037
14033
nconfigitems == nconditionitems )
@@ -14041,21 +14037,54 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
14041
14037
for (j = 0 ; j < nconfigitems ; j ++ )
14042
14038
{
14043
14039
TableInfo * configtbl ;
14040
+ Oid configtbloid = atooid (extconfigarray [j ]);
14041
+ bool dumpobj = curext -> dobj .dump ;
14044
14042
14045
- configtbl = findTableByOid (atooid ( extconfigarray [ j ]) );
14043
+ configtbl = findTableByOid (configtbloid );
14046
14044
if (configtbl == NULL )
14047
14045
continue ;
14048
14046
14049
14047
/*
14050
- * Note: config tables are dumped without OIDs regardless of
14051
- * the --oids setting. This is because row filtering
14052
- * conditions aren't compatible with dumping OIDs.
14048
+ * Tables of not-to-be-dumped extensions shouldn't be dumped
14049
+ * unless the table or its schema is explicitly included
14053
14050
*/
14054
- makeTableDataInfo (configtbl , false);
14055
- if (configtbl -> dataObj != NULL )
14051
+ if (!curext -> dobj .dump )
14056
14052
{
14057
- if (strlen (extconditionarray [j ]) > 0 )
14058
- configtbl -> dataObj -> filtercond = pg_strdup (extconditionarray [j ]);
14053
+ /* check table explicitly requested */
14054
+ if (table_include_oids .head != NULL &&
14055
+ simple_oid_list_member (& table_include_oids ,
14056
+ configtbloid ))
14057
+ dumpobj = true;
14058
+
14059
+ /* check table's schema explicitly requested */
14060
+ if (configtbl -> dobj .namespace -> dobj .dump )
14061
+ dumpobj = true;
14062
+ }
14063
+
14064
+ /* check table excluded by an exclusion switch */
14065
+ if (table_exclude_oids .head != NULL &&
14066
+ simple_oid_list_member (& table_exclude_oids ,
14067
+ configtbloid ))
14068
+ dumpobj = false;
14069
+
14070
+ /* check schema excluded by an exclusion switch */
14071
+ if (simple_oid_list_member (& schema_exclude_oids ,
14072
+ configtbl -> dobj .namespace -> dobj .catId .oid ))
14073
+ dumpobj = false;
14074
+
14075
+ if (dumpobj )
14076
+ {
14077
+ /*
14078
+ * Note: config tables are dumped without OIDs regardless of
14079
+ * the --oids setting. This is because row filtering
14080
+ * conditions aren't compatible with dumping OIDs.
14081
+ */
14082
+ makeTableDataInfo (configtbl , false);
14083
+ if (configtbl -> dataObj != NULL )
14084
+ {
14085
+ if (strlen (extconditionarray [j ]) > 0 )
14086
+ configtbl -> dataObj -> filtercond = pg_strdup (extconditionarray [j ]);
14087
+ }
14059
14088
}
14060
14089
}
14061
14090
}
0 commit comments