write_msg(NULL, "reading schemas\n");
getNamespaces(&numNamespaces);
+ /*
+ * getTables should be done as soon as possible, so as to minimize the
+ * window between starting our transaction and acquiring per-table locks.
+ * However, we have to do getNamespaces first because the tables get
+ * linked to their containing namespaces during getTables.
+ */
+ if (g_verbose)
+ write_msg(NULL, "reading user-defined tables\n");
+ tblinfo = getTables(&numTables);
+ tblinfoindex = buildIndexArray(tblinfo, numTables, sizeof(TableInfo));
+
if (g_verbose)
write_msg(NULL, "reading extensions\n");
extinfo = getExtensions(&numExtensions);
write_msg(NULL, "reading type casts\n");
getCasts(&numCasts);
- if (g_verbose)
- write_msg(NULL, "reading user-defined tables\n");
- tblinfo = getTables(&numTables);
- tblinfoindex = buildIndexArray(tblinfo, numTables, sizeof(TableInfo));
-
if (g_verbose)
write_msg(NULL, "reading table inheritance information\n");
inhinfo = getInherits(&numInherits);