@@ -14028,10 +14028,6 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
1402814028int nconfigitems ;
1402914029int nconditionitems ;
1403014030
14031- /* Tables of not-to-be-dumped extensions shouldn't be dumped */
14032- if (!curext -> dobj .dump )
14033- continue ;
14034-
1403514031if (parsePGArray (extconfig ,& extconfigarray ,& nconfigitems )&&
1403614032parsePGArray (extcondition ,& extconditionarray ,& nconditionitems )&&
1403714033nconfigitems == nconditionitems )
@@ -14041,21 +14037,54 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
1404114037for (j = 0 ;j < nconfigitems ;j ++ )
1404214038{
1404314039TableInfo * configtbl ;
14040+ Oid configtbloid = atooid (extconfigarray [j ]);
14041+ bool dumpobj = curext -> dobj .dump ;
1404414042
14045- configtbl = findTableByOid (atooid ( extconfigarray [ j ]) );
14043+ configtbl = findTableByOid (configtbloid );
1404614044if (configtbl == NULL )
1404714045continue ;
1404814046
1404914047/*
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
1405314050 */
14054- makeTableDataInfo (configtbl , false);
14055- if (configtbl -> dataObj != NULL )
14051+ if (!curext -> dobj .dump )
1405614052{
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+ }
1405914088}
1406014089}
1406114090}