@@ -79,12 +79,12 @@ TableInfo *
7979getSchemaData (int * numTablesPtr )
8080{
8181 NamespaceInfo * nsinfo ;
82+ ExtensionInfo * extinfo ;
8283 AggInfo * agginfo ;
8384 InhInfo * inhinfo ;
8485 RuleInfo * ruleinfo ;
8586 ProcLangInfo * proclanginfo ;
8687 CastInfo * castinfo ;
87- ExtensionInfo * extinfo ;
8888 OpclassInfo * opcinfo ;
8989 OpfamilyInfo * opfinfo ;
9090 ConvInfo * convinfo ;
@@ -96,12 +96,12 @@ getSchemaData(int *numTablesPtr)
9696 ForeignServerInfo * srvinfo ;
9797 DefaultACLInfo * daclinfo ;
9898 int numNamespaces ;
99+ int numExtensions ;
99100 int numAggregates ;
100101 int numInherits ;
101102 int numRules ;
102103 int numProcLangs ;
103104 int numCasts ;
104- int numExtensions ;
105105 int numOpclasses ;
106106 int numOpfamilies ;
107107 int numConversions ;
@@ -117,6 +117,10 @@ getSchemaData(int *numTablesPtr)
117117 write_msg (NULL , "reading schemas\n" );
118118 nsinfo = getNamespaces (& numNamespaces );
119119
120+ if (g_verbose )
121+ write_msg (NULL , "reading extensions\n" );
122+ extinfo = getExtensions (& numExtensions );
123+
120124 if (g_verbose )
121125 write_msg (NULL , "reading user-defined functions\n" );
122126 funinfo = getFuncs (& numFuncs );
@@ -146,6 +150,10 @@ getSchemaData(int *numTablesPtr)
146150 write_msg (NULL , "reading user-defined operator classes\n" );
147151 opcinfo = getOpclasses (& numOpclasses );
148152
153+ if (g_verbose )
154+ write_msg (NULL , "reading user-defined operator families\n" );
155+ opfinfo = getOpfamilies (& numOpfamilies );
156+
149157 if (g_verbose )
150158 write_msg (NULL , "reading user-defined text search parsers\n" );
151159 prsinfo = getTSParsers (& numTSParsers );
@@ -174,14 +182,14 @@ getSchemaData(int *numTablesPtr)
174182 write_msg (NULL , "reading default privileges\n" );
175183 daclinfo = getDefaultACLs (& numDefaultACLs );
176184
177- if (g_verbose )
178- write_msg (NULL , "reading user-defined operator families\n" );
179- opfinfo = getOpfamilies (& numOpfamilies );
180-
181185 if (g_verbose )
182186 write_msg (NULL , "reading user-defined conversions\n" );
183187 convinfo = getConversions (& numConversions );
184188
189+ if (g_verbose )
190+ write_msg (NULL , "reading type casts\n" );
191+ castinfo = getCasts (& numCasts );
192+
185193 if (g_verbose )
186194 write_msg (NULL , "reading user-defined tables\n" );
187195 tblinfo = getTables (& numTables );
@@ -195,14 +203,14 @@ getSchemaData(int *numTablesPtr)
195203 write_msg (NULL , "reading rewrite rules\n" );
196204 ruleinfo = getRules (& numRules );
197205
206+ /*
207+ * Identify extension member objects and mark them as not to be dumped.
208+ * This must happen after reading all objects that can be direct members
209+ * of extensions, but before we begin to process table subsidiary objects.
210+ */
198211 if (g_verbose )
199- write_msg (NULL , "reading type casts\n" );
200- castinfo = getCasts (& numCasts );
201-
202- /* this must be after getTables */
203- if (g_verbose )
204- write_msg (NULL , "reading extensions\n" );
205- extinfo = getExtensions (& numExtensions );
212+ write_msg (NULL , "finding extension members\n" );
213+ getExtensionMembership (extinfo , numExtensions );
206214
207215 /* Link tables to parents, mark parents of target tables interesting */
208216 if (g_verbose )
@@ -525,9 +533,9 @@ findObjectByDumpId(DumpId dumpId)
525533 * Returns NULL for unknown ID
526534 *
527535 * We use binary search in a sorted list that is built on first call.
528- * If AssignDumpId() and findObjectByCatalogId() calls were intermixed,
536+ * If AssignDumpId() and findObjectByCatalogId() calls were freely intermixed,
529537 * the code would work, but possibly be very slow. In the current usage
530- * pattern that does not happen, indeed we only need to build the list once .
538+ * pattern that does not happen, indeed we build the list at most twice .
531539 */
532540DumpableObject *
533541findObjectByCatalogId (CatalogId catalogId )
0 commit comments