1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

Fix pg_restore to properly discard COPY data when trying to continue

after an error in a COPY statement.  Formerly it thought the COPY data
was SQL commands, and got quite confused.

Stephen Frost
This commit is contained in:
Tom Lane
2006-02-05 20:58:47 +00:00
parent db5e39b2f0
commit 8e4057cc7d
3 changed files with 30 additions and 14 deletions

View File

@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.119 2006/01/21 02:16:20 momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.120 2006/02/05 20:58:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -330,10 +330,15 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
* with libpq.
*/
if (te->copyStmt && strlen(te->copyStmt) > 0)
{
ahprintf(AH, "%s", te->copyStmt);
AH->writingCopyData = true;
}
(*AH->PrintTocDataPtr) (AH, te, ropt);
AH->writingCopyData = false;
_enableTriggersIfNecessary(AH, te, ropt);
}
}