@@ -13885,10 +13885,6 @@ getExtensionMembership(ExtensionInfo extinfo[], int numExtensions)
13885
13885
int nconfigitems ;
13886
13886
int nconditionitems ;
13887
13887
13888
- /* Tables of not-to-be-dumped extensions shouldn't be dumped */
13889
- if (!curext -> dobj .dump )
13890
- continue ;
13891
-
13892
13888
if (parsePGArray (extconfig , & extconfigarray , & nconfigitems ) &&
13893
13889
parsePGArray (extcondition , & extconditionarray , & nconditionitems ) &&
13894
13890
nconfigitems == nconditionitems )
@@ -13898,18 +13894,51 @@ getExtensionMembership(ExtensionInfo extinfo[], int numExtensions)
13898
13894
for (j = 0 ; j < nconfigitems ; j ++ )
13899
13895
{
13900
13896
TableInfo * configtbl ;
13897
+ Oid configtbloid = atooid (extconfigarray [j ]);
13898
+ bool dumpobj = curext -> dobj .dump ;
13901
13899
13902
- configtbl = findTableByOid (atooid ( extconfigarray [ j ]) );
13900
+ configtbl = findTableByOid (configtbloid );
13903
13901
if (configtbl && configtbl -> dataObj == NULL )
13904
13902
{
13905
13903
/*
13906
- * Note: config tables are dumped without OIDs regardless
13907
- * of the --oids setting. This is because row filtering
13908
- * conditions aren't compatible with dumping OIDs.
13904
+ * Tables of not-to-be-dumped extensions shouldn't be dumped
13905
+ * unless the table or its schema is explicitly included
13909
13906
*/
13910
- makeTableDataInfo (configtbl , false);
13911
- if (strlen (extconditionarray [j ]) > 0 )
13912
- configtbl -> dataObj -> filtercond = strdup (extconditionarray [j ]);
13907
+ if (!curext -> dobj .dump )
13908
+ {
13909
+ /* check table explicitly requested */
13910
+ if (table_include_oids .head != NULL &&
13911
+ simple_oid_list_member (& table_include_oids ,
13912
+ configtbloid ))
13913
+ dumpobj = true;
13914
+
13915
+ /* check table's schema explicitly requested */
13916
+ if (configtbl -> dobj .namespace -> dobj .dump )
13917
+ dumpobj = true;
13918
+ }
13919
+
13920
+ /* check table excluded by an exclusion switch */
13921
+ if (table_exclude_oids .head != NULL &&
13922
+ simple_oid_list_member (& table_exclude_oids ,
13923
+ configtbloid ))
13924
+ dumpobj = false;
13925
+
13926
+ /* check schema excluded by an exclusion switch */
13927
+ if (simple_oid_list_member (& schema_exclude_oids ,
13928
+ configtbl -> dobj .namespace -> dobj .catId .oid ))
13929
+ dumpobj = false;
13930
+
13931
+ if (dumpobj )
13932
+ {
13933
+ /*
13934
+ * Note: config tables are dumped without OIDs regardless
13935
+ * of the --oids setting. This is because row filtering
13936
+ * conditions aren't compatible with dumping OIDs.
13937
+ */
13938
+ makeTableDataInfo (configtbl , false);
13939
+ if (strlen (extconditionarray [j ]) > 0 )
13940
+ configtbl -> dataObj -> filtercond = strdup (extconditionarray [j ]);
13941
+ }
13913
13942
}
13914
13943
}
13915
13944
}
0 commit comments