@@ -14621,10 +14621,6 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
1462114621int nconfigitems ;
1462214622int nconditionitems ;
1462314623
14624- /* Tables of not-to-be-dumped extensions shouldn't be dumped */
14625- if (!curext -> dobj .dump )
14626- continue ;
14627-
1462814624if (parsePGArray (extconfig ,& extconfigarray ,& nconfigitems )&&
1462914625parsePGArray (extcondition ,& extconditionarray ,& nconditionitems )&&
1463014626nconfigitems == nconditionitems )
@@ -14634,21 +14630,54 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
1463414630for (j = 0 ;j < nconfigitems ;j ++ )
1463514631{
1463614632TableInfo * configtbl ;
14633+ Oid configtbloid = atooid (extconfigarray [j ]);
14634+ bool dumpobj = curext -> dobj .dump ;
1463714635
14638- configtbl = findTableByOid (atooid ( extconfigarray [ j ]) );
14636+ configtbl = findTableByOid (configtbloid );
1463914637if (configtbl == NULL )
1464014638continue ;
1464114639
1464214640/*
14643- * Note: config tables are dumped without OIDs regardless of
14644- * the --oids setting.This is because row filtering
14645- * conditions aren't compatible with dumping OIDs.
14641+ * Tables of not-to-be-dumped extensions shouldn't be dumped
14642+ * unless the table or its schema is explicitly included
1464614643 */
14647- makeTableDataInfo (configtbl , false);
14648- if (configtbl -> dataObj != NULL )
14644+ if (!curext -> dobj .dump )
1464914645{
14650- if (strlen (extconditionarray [j ])> 0 )
14651- configtbl -> dataObj -> filtercond = pg_strdup (extconditionarray [j ]);
14646+ /* check table explicitly requested */
14647+ if (table_include_oids .head != NULL &&
14648+ simple_oid_list_member (& table_include_oids ,
14649+ configtbloid ))
14650+ dumpobj = true;
14651+
14652+ /* check table's schema explicitly requested */
14653+ if (configtbl -> dobj .namespace -> dobj .dump )
14654+ dumpobj = true;
14655+ }
14656+
14657+ /* check table excluded by an exclusion switch */
14658+ if (table_exclude_oids .head != NULL &&
14659+ simple_oid_list_member (& table_exclude_oids ,
14660+ configtbloid ))
14661+ dumpobj = false;
14662+
14663+ /* check schema excluded by an exclusion switch */
14664+ if (simple_oid_list_member (& schema_exclude_oids ,
14665+ configtbl -> dobj .namespace -> dobj .catId .oid ))
14666+ dumpobj = false;
14667+
14668+ if (dumpobj )
14669+ {
14670+ /*
14671+ * Note: config tables are dumped without OIDs regardless of
14672+ * the --oids setting.This is because row filtering
14673+ * conditions aren't compatible with dumping OIDs.
14674+ */
14675+ makeTableDataInfo (configtbl , false);
14676+ if (configtbl -> dataObj != NULL )
14677+ {
14678+ if (strlen (extconditionarray [j ])> 0 )
14679+ configtbl -> dataObj -> filtercond = pg_strdup (extconditionarray [j ]);
14680+ }
1465214681}
1465314682}
1465414683}