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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user