diff options
-rw-r--r-- | src/bin/pg_dump/common.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index 070036ec054..7ea98b396fa 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -91,6 +91,16 @@ getSchemaData(int *numTablesPtr) write_msg(NULL, "reading schemas\n"); nsinfo = 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); + if (g_verbose) write_msg(NULL, "reading user-defined functions\n"); funinfo = getFuncs(&numFuncs); @@ -122,10 +132,6 @@ getSchemaData(int *numTablesPtr) convinfo = getConversions(&numConversions); if (g_verbose) - write_msg(NULL, "reading user-defined tables\n"); - tblinfo = getTables(&numTables); - - if (g_verbose) write_msg(NULL, "reading table inheritance information\n"); inhinfo = getInherits(&numInherits); |