diff -ruN postgresql-8.1.3-old/src/bin/pg_dump/pg_backup_archiver.c postgresql-8.1.3/src/bin/pg_dump/pg_backup_archiver.c --- postgresql-8.1.3-old/src/bin/pg_dump/pg_backup_archiver.c 2006-02-05 21:58:57.000000000 +0100 +++ postgresql-8.1.3/src/bin/pg_dump/pg_backup_archiver.c 2006-02-19 14:20:36.000000000 +0100 @@ -268,6 +268,20 @@ _printTocEntry(AH, te, ropt, false, false); defnDumped = true; + /* If we could not create a table, ignore the respective TABLE DATA */ + if (AH->lastErrorTE == te && strcmp (te->desc, "TABLE") == 0) { + TocEntry *tes; + + ahlog (AH, 1, "table %s could not be created, will not restore its data\n", te->tag); + + for (tes = te->next; tes != AH->toc; tes = tes->next) { + if (strcmp (tes->desc, "TABLE DATA") == 0 && strcmp (tes->tag, te->tag) == 0) { + strcpy (tes->desc, "IGNOREDATA"); + break; + } + } + } + /* If we created a DB, connect to it... */ if (strcmp(te->desc, "DATABASE") == 0) { @@ -1876,6 +1889,10 @@ if (strcmp(te->desc, "ENCODING") == 0) return 0; + /* IGNOREDATA is a TABLE DATA which should not be restored */ + if (strcmp (te->desc, "IGNOREDATA") == 0) + return 0; + /* If it's an ACL, maybe ignore it */ if ((!include_acls || ropt->aclsSkip) && strcmp(te->desc, "ACL") == 0) return 0;