@@ -13885,10 +13885,6 @@ getExtensionMembership(ExtensionInfo extinfo[], int numExtensions)
1388513885int nconfigitems ;
1388613886int nconditionitems ;
1388713887
13888- /* Tables of not-to-be-dumped extensions shouldn't be dumped */
13889- if (!curext -> dobj .dump )
13890- continue ;
13891-
1389213888if (parsePGArray (extconfig ,& extconfigarray ,& nconfigitems )&&
1389313889parsePGArray (extcondition ,& extconditionarray ,& nconditionitems )&&
1389413890nconfigitems == nconditionitems )
@@ -13898,18 +13894,51 @@ getExtensionMembership(ExtensionInfo extinfo[], int numExtensions)
1389813894for (j = 0 ;j < nconfigitems ;j ++ )
1389913895{
1390013896TableInfo * configtbl ;
13897+ Oid configtbloid = atooid (extconfigarray [j ]);
13898+ bool dumpobj = curext -> dobj .dump ;
1390113899
13902- configtbl = findTableByOid (atooid ( extconfigarray [ j ]) );
13900+ configtbl = findTableByOid (configtbloid );
1390313901if (configtbl && configtbl -> dataObj == NULL )
1390413902{
1390513903/*
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
1390913906 */
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+ }
1391313942}
1391413943}
1391513944}