Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b9e8ffc

Browse files
committed
pg_restore failed to restore blobs if -X disable-triggers is specified.
1 parent dd04e95 commit b9e8ffc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/bin/pg_dump/pg_backup_archiver.c

+11-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.68 2003/02/14 19:40:42 momjian Exp $
18+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.69 2003/03/09 19:38:52 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -294,7 +294,8 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
294294
* Maybe we can't do BLOBS, so check if this node is
295295
* for BLOBS
296296
*/
297-
if ((strcmp(te->desc, "BLOBS") == 0) && !_canRestoreBlobs(AH))
297+
if ((strcmp(te->desc, "BLOBS") == 0) &&
298+
!_canRestoreBlobs(AH))
298299
{
299300
ahprintf(AH, "--\n-- SKIPPED \n--\n\n");
300301

@@ -446,6 +447,10 @@ _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *rop
446447
if (!ropt->dataOnly || !ropt->disable_triggers)
447448
return;
448449

450+
/* Don't do it for the BLOBS TocEntry, either */
451+
if (te && strcmp(te->desc, "BLOBS") == 0)
452+
return;
453+
449454
oldUser = strdup(AH->currUser);
450455
oldSchema = strdup(AH->currSchema);
451456

@@ -509,6 +514,10 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt
509514
if (!ropt->dataOnly || !ropt->disable_triggers)
510515
return;
511516

517+
/* Don't do it for the BLOBS TocEntry, either */
518+
if (te && strcmp(te->desc, "BLOBS") == 0)
519+
return;
520+
512521
oldUser = strdup(AH->currUser);
513522
oldSchema = strdup(AH->currSchema);
514523

0 commit comments

Comments
 (0)