diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 8f1f6c1..2e5063a 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -439,7 +439,6 @@ RestoreArchive(Archive *AHX) */ _doSetFixedOutputState(AH); - AH->stage = STAGE_PROCESSING; /* * Drop the items at the start, in reverse order @@ -581,6 +580,8 @@ RestoreArchive(Archive *AHX) AH->currSchema = NULL; } + AH->stage = STAGE_PROCESSING; + /* * In serial mode, we now process each non-ACL TOC entry. * @@ -715,7 +716,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, if (strcmp(te->desc, "TABLE") == 0) { - if (AH->lastErrorTE == te) + if (te->wasError && AH->lastErrorStage == STAGE_PROCESSING ) { /* * We failed to create the table. If @@ -1027,6 +1028,9 @@ ArchiveEntry(Archive *AHX, newToc->formatData = NULL; + newToc->created = false; + newToc->wasError = false; + if (AH->ArchiveEntryPtr !=NULL) (*AH->ArchiveEntryPtr) (AH, newToc); } @@ -1665,15 +1669,15 @@ warn_or_exit_horribly(ArchiveHandle *AH, write_msg(modulename, "Error while FINALIZING:\n"); break; } - if (AH->currentTE != NULL && AH->currentTE != AH->lastErrorTE) + if (AH->currentTE != NULL && !AH->currentTE->wasError) { write_msg(modulename, "Error from TOC entry %d; %u %u %s %s %s\n", AH->currentTE->dumpId, AH->currentTE->catalogId.tableoid, AH->currentTE->catalogId.oid, AH->currentTE->desc, AH->currentTE->tag, AH->currentTE->owner); + AH->currentTE->wasError = true; } AH->lastErrorStage = AH->stage; - AH->lastErrorTE = AH->currentTE; va_start(ap, fmt); vwrite_msg(modulename, fmt, ap); diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index 620ada5..7e02531 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -332,7 +332,6 @@ struct _archiveHandle ArchiverStage stage; ArchiverStage lastErrorStage; struct _tocEntry *currentTE; - struct _tocEntry *lastErrorTE; }; struct _tocEntry @@ -364,6 +363,7 @@ struct _tocEntry /* working state while dumping/restoring */ teReqs reqs; /* do we need schema and/or data of object */ bool created; /* set for DATA member if TABLE was created */ + bool wasError; /* set true if Error occured in this toc. */ /* working state (needed only for parallel restore) */ struct _tocEntry *par_prev; /* list links for pending/ready items; */ diff --git a/src/bin/pg_dump/po/ja.po b/src/bin/pg_dump/po/ja.po index 980eab6..0189f3f 100644 --- a/src/bin/pg_dump/po/ja.po +++ b/src/bin/pg_dump/po/ja.po @@ -2415,7 +2415,7 @@ msgid "" " --no-data-for-failed-tables do not restore data of tables that could not be\n" " created\n" msgstr "" -" --no-data-for-failed-tables 作成できなかったテーッブルのデータはリストア\n" +" --no-data-for-failed-tables 作成できなかったテーブルのデータはリストア\n" " しません\n" #: pg_restore.c:461