@@ -14621,10 +14621,6 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
14621
14621
int nconfigitems ;
14622
14622
int nconditionitems ;
14623
14623
14624
- /* Tables of not-to-be-dumped extensions shouldn't be dumped */
14625
- if (!curext -> dobj .dump )
14626
- continue ;
14627
-
14628
14624
if (parsePGArray (extconfig , & extconfigarray , & nconfigitems ) &&
14629
14625
parsePGArray (extcondition , & extconditionarray , & nconditionitems ) &&
14630
14626
nconfigitems == nconditionitems )
@@ -14634,21 +14630,54 @@ getExtensionMembership(Archive *fout, ExtensionInfo extinfo[],
14634
14630
for (j = 0 ; j < nconfigitems ; j ++ )
14635
14631
{
14636
14632
TableInfo * configtbl ;
14633
+ Oid configtbloid = atooid (extconfigarray [j ]);
14634
+ bool dumpobj = curext -> dobj .dump ;
14637
14635
14638
- configtbl = findTableByOid (atooid ( extconfigarray [ j ]) );
14636
+ configtbl = findTableByOid (configtbloid );
14639
14637
if (configtbl == NULL )
14640
14638
continue ;
14641
14639
14642
14640
/*
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
14646
14643
*/
14647
- makeTableDataInfo (configtbl , false);
14648
- if (configtbl -> dataObj != NULL )
14644
+ if (!curext -> dobj .dump )
14649
14645
{
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
+ }
14652
14681
}
14653
14682
}
14654
14683
}
0 commit comments