diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index ded9135..0393153 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -4140,11 +4140,10 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te) return; /* - * We assume the item requires exclusive lock on each TABLE DATA item - * listed among its dependencies. (This was originally a dependency on - * the TABLE, but fix_dependencies repointed it to the data item. Note - * that all the entry types we are interested in here are POST_DATA, so - * they will all have been changed this way.) + * We assume the item requires exclusive lock on each TABLE or TABLE DATA + * item listed among its dependencies. (fix_dependencies may have + * repointed TABLE dependencies at TABLE DATA items, but not in a + * schema-only dump.) */ lockids = (DumpId *) pg_malloc(te->nDeps * sizeof(DumpId)); nlockids = 0; @@ -4153,7 +4152,8 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te) DumpId depid = te->dependencies[i]; if (depid <= AH->maxDumpId && AH->tocsByDumpId[depid] != NULL && - strcmp(AH->tocsByDumpId[depid]->desc, "TABLE DATA") == 0) + ((strcmp(AH->tocsByDumpId[depid]->desc, "TABLE DATA") == 0) || + strcmp(AH->tocsByDumpId[depid]->desc, "TABLE") == 0)) lockids[nlockids++] = depid; }